— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet491/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   487   488   489   490   491   492   493   494   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

%java Jukebox1
[Pink Moon, Somersault, 
Shiva Moon, Circles, 
Deep Channel, Passenger, 
Listen]
The songList prints out with the 
songs in the order in which they 
were added to the ArrayList (which 
is the same order the songs are in 
within the original text file).
This is definitely NOT alphabetical
!


532
 
chapter 16
The question is, how do we get an object on one machine 
(which means a different heap/JVM) to call a method on 
another machine?
But the ArrayList class does NOT have a sort() method!
When you look in ArrayList, there doesn’t seem to be any method related to sorting. 
Walking up the inheritance hierarchy didn’t help either—it’s clear that you can’t call a sort 
method on the ArrayList. 
ArrayList has a lot of methods, 
but there’s nothing here that 
looks like it would sort...
ArrayList 
API


collections 
with 
generics
you are here
4
533
The question is, how do we get an object on one machine 
(which means a different heap/JVM) to call a method on 
another machine?
I do see a collection class 
called TreeSet... and the docs 
say that it keeps your data 
sorted. I wonder if I should be 
using a TreeSet instead of an 
ArrayList...
ArrayList is not the only collection
Although ArrayList is the one you’ll use most often, 
there are others for special occasions. Some of the key 
collection classes include:
$
TreeSet
Keeps the elements sorted and prevents duplicates. 
$

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   487   488   489   490   491   492   493   494   ...   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