Java Interview Guide: How to Build Confidence With a Solid Understanding of Core Java Principles pdfdrive com



Download 0,53 Mb.
Pdf ko'rish
bet5/47
Sana12.07.2022
Hajmi0,53 Mb.
#783570
1   2   3   4   5   6   7   8   9   ...   47
Bog'liq
11-Java Interview Guide

Packages
Classes and other resources are organized into folders with unique namespaces
called packages. Packages are commonly organized by two competing
methodologies: 
package-by-layer
and 
package-by-feature
.

package-by-layer
strategy groups classes together according to their layer
in an application. For example, a 
package-by-layer
structure might include
a model, controller, service, dao, and utility package. 
Package-by-layer
works
for small applications, but it doesn’t scale well due to the large number of tightly
coupled classes that span a relatively small number of packages.

package-by-feature
strategy groups classes together according to their
cohesiveness in an application. For example, 
a package-by-feature
structure
might include a customer, order, product, review, and report package. 
Package-
by-feature
encourages high modularity and loose coupling and is preferable
to 
package-by-layer
.


Questions
What is the difference between a class and an object?
What happens when an object is instantiated for the first time?
What is the difference between a primitive type and an object?
What is the difference between autoboxing and unboxing?
What is an array?
How is a String different from a regular object?
What is the difference between a StringBuilder and a StringBuffer?
Why are enums superior to String or Integer constants?
What is the difference between package-by-layer and package-by-feature?


Object-Oriented Programming
(Part II)
Methods
Methods contain the logic that provide an object with behavior. A method
declaration contains a list of modifiers, a return type, a method name, a list
of parameter types and their corresponding names, and a list of throwable
exceptions. A method signature is the combination of the method name as well
as the types and order of its parameters. Note that the names of parameters are
not included in the method signature.
A method can invoke itself in a process called recursion. Recursion is an
alternative to looping that provides an elegant solution for problems that
naturally repeat, such as mathematical sequences or divide and conquer
algorithms. A recursive method must have a termination condition that
determines when the method stops calling itself and starts returning values
to previous invocations on the call stack. A recursive method with
no termination condition will eventually cause a 
StackOverflowError
.



Download 0,53 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   47




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish