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



Download 17,18 Mb.
Pdf ko'rish
bet73/90
Sana22.06.2022
Hajmi17,18 Mb.
#693704
1   ...   69   70   71   72   73   74   75   76   ...   90
Bog'liq
(Head Up) Kathy Sierra Bert Bates - Head First Java, 3rd Edition Early Release-O\'Reilly Media, Inc. (2021)

Game play begins
. Prompt user for a guess, then check to see if it hit
any of the Startup’s three cells. If a hit, increment the numOfHits variable.
Game finishes
when all three cells have been hit (the numOfHits
variable value is 3), and tells the user how many guesses it took to sink the
Startup.
Developing a Class
As a programmer, you probably have a methodology/ process/approach to
writing code. Well, so do we. Our sequence is designed to help you see (and
learn) what we’re thinking as we work through coding a class. It isn’t
necessarily the way we (or 
you)
write code in the Real World. In the Real
World, of course, you’ll follow the approach your personal preferences,


project, or employer dictate. We, however, can do pretty much whatever we
want. And when we create a Java class as a “learning experience”, we
usually do it like this:
Figure out what the class is supposed to 
do
.
List the 
instance variables and methods
.
Write 
prepcode
for the methods. (You’ll see this in just a
moment.)
Write 
test code
for the methods.
Implement
the class.
Test
the methods.
Debug
and 
reimplement
as needed.
Express gratitude that we don’t have to test our so-called
learning experience
app on actual live users.
 Brain Power
Flex those dendrites.
How would you decide which class or classes to build first, when you’re
writing a program? Assuming that all but the tiniest programs need
more than one class (if you’re following good OO principles and not
having one class do many different jobs), where do you start?

Download 17,18 Mb.

Do'stlaringiz bilan baham:
1   ...   69   70   71   72   73   74   75   76   ...   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