— Scott McNealy, Sun Microsystems Chairman, President and ceo



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

HashMap
Let’s you store and access elements as name/value pairs.
$
LinkedList
Designed to give better performance when you insert or delete 
elements from the middle of the collection. (In practice, an 
ArrayList is still usually what you want.)
$
HashSet
Prevents duplicates in the collection, and given an element, can 
find that element in the collection quickly.
$
LinkedHashMap
Like a regular HashMap, except it can remember the order in 
which elements (name/value pairs) were inserted, or it can be 
configured to remember the order in which elements were last 
accessed.
Don’t worry about trying 
to learn these other ones 
right now. We’ll go into 
more details a little later.


534
 
chapter 16
If you put all the Strings (the song titles) into a TreeSet instead of 
an ArrayList, the Strings would automatically land in the right place, 
alphabetically sorted. Whenever you printed the list, the elements would 
always come out in alphabetical order.
And that’s great when you need a set (we’ll 
talk about sets in a few minutes) or when 
you know that the list must always stay 
sorted alphabetically.
On the other hand, if you don’t need the 
list to stay sorted, TreeSet might be more 
expensive than you need—every time you 
insert into a TreeSet, the TreeSet has to take 
the time to fi gure out where in the tree the new 
element must go. 
With ArrayList, inserts can 
be blindingly fast because the new element 
just goes in at the end.
You 
could use a TreeSet...
Or you could use the Collections.sort() method
Collections.

Download 40,57 Mb.

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