— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet208/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   204   205   206   207   208   209   210   211   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

214
 
chapter 8
An object contains everything it inherits from each of its 
superclasses. That means every object—regardless of its 
actual class type—is also an instance of class Object.That 
means any object in Java can be treated not just as a Dog, 
Button, or Snowboard, but also as an Object. When you 
say 
new Snowboard()
, you get a single object on the 
heap—a Snowboard object—but that Snowboard wraps 
itself around an inner core representing the Object 
(capital “O”) portion of itself.
Get in touch with your inner Object.
There is only ONE object on the heap here. A Snowboard 
object. But it contains both the Snowboard class parts of 
itself and the Object class parts of itself. 
objects are 
Objects
Object
equals()
getClass()
hashCode()
toString()
Snowboard
equals()
getClass()
hashCode()
toString()
turn()
shred()
getAir()
loseControl()
Snowboard inherits methods 
from superclass Object, and 
adds four more.
to
St
rin
g() hashC
od
e(
)
ge
tA
ir()
turn()
sh
re
d()
eq
ua
ls()
getC
las
s(
)
loseC
on
tro
l(
)
Object
Snowboard
S
n
owboard obj
e
c
t
He treats me like an 
Object. But I can do so 
much more...if only he’d see 
me for what I 
really am.
A single object 
on the heap.


interfaces and 
polymorphism
you are here
4
215
Snowboard 
s

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   204   205   206   207   208   209   210   211   ...   555




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