— Scott McNealy, Sun Microsystems Chairman, President and ceo


know that the Java library



Download 40,57 Mb.
Pdf ko'rish
bet135/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   131   132   133   134   135   136   137   138   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

know that the Java library 
comes with ArrayList, but more 
importantly I have to know 
that ArrayList is the thing that 
can do what I want! So how 
do I go from a need-to-do-
something to a-way-to-do-it 
using the API?
A:
Now you’re really at the 
heart of it. By the time you’ve 
finished this book, you’ll have 
a good grasp of the language, 
and the rest of your learning 
curve really is about knowing 
how to get from a problem to 
a solution, with you writing the 
least amount of code. If you can 
be patient for a few more pages, 
we start talking about it at the 
end of this chapter.
HeadFirst:
So, ArrayLists are like arrays, right?
ArrayList:
In their dreams! 

am an object thank you very much.
HeadFirst: 
If I’m not mistaken, arrays are objects too. They live on the heap right 
there with all the other objects.
ArrayList: 
Sure arrays go on the heap, duh, but an array is still a wanna-be 
ArrayList. A poser. Objects have state and behavior, right? We’re clear on that. But 
have you actually tried calling a method on an array?
HeadFirst: 
Now that you mention it, can’t say I have. But what method would I 
call, anyway? I only care about calling methods on the stuff I put in the array, not 
the array itself. And I can use array syntax when I want to put things in and take 
things out of the array.
ArrayList: 
Is that so? You mean to tell me you actually removed something from an 
array? (Sheesh, where do they train you guys? McJava’s?)
HeadFirst: 
Of course I take something out of the array. I say Dog d = dogArray[1] 
and I get the Dog object at index 1 out of the array.

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   131   132   133   134   135   136   137   138   ...   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