— Scott McNealy, Sun Microsystems Chairman, President and ceo



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

and 
generics
Sheesh... and all 
this time I could have just let 
Java put things in alphabetical 
order? Third grade really 
sucks. We never learn 
anything useful...


530
 
chapter 16
You have a list of songs in a fi le, where each line 
represents one song, and the title and artist are 
separated with a forward slash. So it should be simple 
to parse the line, and put all the songs in an ArrayList.
Your boss cares only about the song titles, so for now 
you can simply make a list that just has the song titles.
But you can see that the list is not in alphabetical 
order... what can you do?
You know that with an ArrayList, the elements are 
kept in the order in which they were inserted into the 
list, so putting them in an ArrayList won’t take care of 
alphabetizing them, unless... maybe there’s a sort() 
method in the ArrayList class?
Congratulations on your new job—managing the automated 
jukebox system at Lou’s Diner. There’s no Java inside the 
jukebox itself, but each time someone plays a song, the 
song data is appended to a simple text fi le. 
Your job is to manage the data to track song popularity, 
generate reports, and manipulate the playlists. You’re not 
writing the entire app—some of the other software developer/
waiters are involved as well, but you’re responsible for managing 
and sorting the data inside the Java app. And since Lou has a thing 
against databases, this is strictly an in-memory data collection. All 
you get is the fi le the jukebox keeps adding to. Your job is to take it 
from there. 
You’ve already fi gured out how to read and parse the fi le, and so far 
you’ve been storing the data in an ArrayList.
Tracking song popularity on your jukebox

Download 40,57 Mb.

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