Core Java® Volume I–Fundamentals


Chapter 4: Objects and Classes



Download 37,53 Mb.
Pdf ko'rish
bet5/34
Sana06.01.2022
Hajmi37,53 Mb.
#325163
1   2   3   4   5   6   7   8   9   ...   34
Bog'liq
9780134177373-Vol-1

129

Chapter 4: Objects and Classes ................................................................

130


Introduction to Object-Oriented Programming ..................................

4.1


131

Classes .........................................................................................

4.1.1

132


Objects .........................................................................................

4.1.2


133

Identifying Classes ....................................................................

4.1.3

133


Relationships between Classes ................................................

4.1.4


135

Using Predefined Classes .......................................................................

4.2

136


Objects and Object Variables ....................................................

4.2.1


139

The 


LocalDate

 Class of the Java Library .....................................

4.2.2

141


Mutator and Accessor Methods ..............................................

4.2.3


145

Defining Your Own Classes ...................................................................

4.3

145


An 

Employee


 Class .........................................................................

4.3.1


149

Use of Multiple Source Files ....................................................

4.3.2

149


Dissecting the 

Employee


 Class ......................................................

4.3.3


150

First Steps with Constructors ..................................................

4.3.4

152


Implicit and Explicit Parameters .............................................

4.3.5


153

Benefits of Encapsulation .........................................................

4.3.6

156


Class-Based Access Privileges ..................................................

4.3.7


vii

Contents


From the Library of Hristo Dimov Hristov


ptg18360597

156


Private Methods .........................................................................

4.3.8


157

Final Instance Fields ..................................................................

4.3.9

158


Static Fields and Methods .......................................................................

4.4


158

Static Fields .................................................................................

4.4.1

159


Static Constants ..........................................................................

4.4.2


160

Static Methods ............................................................................

4.4.3

161


Factory Methods ........................................................................

4.4.4


161

The 


main

 Method .........................................................................

4.4.5

164


Method Parameters ..................................................................................

4.5


171

Object Construction .................................................................................

4.6

172


Overloading ................................................................................

4.6.1


172

Default Field Initialization .......................................................

4.6.2

173


The Constructor with No Arguments .....................................

4.6.3


174

Explicit Field Initialization .......................................................

4.6.4

175


Parameter Names ......................................................................

4.6.5


176

Calling Another Constructor ...................................................

4.6.6

177


Initialization Blocks ...................................................................

4.6.7


181

Object Destruction and the 

finalize

 Method ...........................

4.6.8

182


Packages ....................................................................................................

4.7


183

Class Importation ......................................................................

4.7.1

185


Static Imports .............................................................................

4.7.2


185

Addition of a Class into a Package .........................................

4.7.3

189


Package Scope ............................................................................

4.7.4


190

The Class Path ...........................................................................................

4.8

193


Setting the Class Path ................................................................

4.8.1


194

Documentation Comments ....................................................................

4.9

194


Comment Insertion ...................................................................

4.9.1


195

Class Comments ........................................................................

4.9.2

195


Method Comments ...................................................................

4.9.3


196

Field Comments ........................................................................

4.9.4

196


General Comments ...................................................................

4.9.5


198

Package and Overview Comments .........................................

4.9.6

198


Comment Extraction .................................................................

4.9.7


200

Class Design Hints ..................................................................................

4.10

Contents


viii

From the Library of Hristo Dimov Hristov




ptg18360597


Download 37,53 Mb.

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




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