Head First Java a brain-Friendly Guide Kathy Sierra and Bert Bates



Download 17,18 Mb.
Pdf ko'rish
bet22/90
Sana22.06.2022
Hajmi17,18 Mb.
#693704
1   ...   18   19   20   21   22   23   24   25   ...   90
Bog'liq
(Head Up) Kathy Sierra Bert Bates - Head First Java, 3rd Edition Early Release-O\'Reilly Media, Inc. (2021)

// calculate the center point
// based on a rectangle,
// then rotate
// else
// use the xPt and yPt as
// the rotation point offset
// and then rotate
}


At Brad’s laptop on his lawn chair at the Telluride
Bluegrass Festival
Without missing a beat, Brad modified the rotate 
method
, but only in the
Amoeba class. 
He never touched the tested, working, compiled code
for
the other parts of the program. To give the Amoeba a rotation point, he
added an 
attribute
that all Amoebas would have. He modified, tested, and
delivered (wirelessly) the revised program during a single Bela Fleck set.
So, Brad the OO guy got the chair and desk, right?
Not so fast.
Larry found a flaw in Brad’s approach. And, since he was sure
that if he got the chair and desk, he’d also get Lucy in accounting, he had to
turn this thing around.
LARRY:
You’ve got duplicated code! The rotate procedure is in all four
Shape things.
BRAD:
It’s a 
method
, not a 
procedure
. And they’re 
classes
, not 
things
.
LARRY:
Whatever. It’s a stupid design. You have to maintain 
four
different
rotate “methods”. How can that ever be good?


BRAD:
Oh, I guess you didn’t see the final design. Let me show you how
OO 
inheritance
works, Larry.



You can read this as, 

Download 17,18 Mb.

Do'stlaringiz bilan baham:
1   ...   18   19   20   21   22   23   24   25   ...   90




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