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



Download 17,18 Mb.
Pdf ko'rish
bet13/90
Sana22.06.2022
Hajmi17,18 Mb.
#693704
1   ...   9   10   11   12   13   14   15   16   ...   90
Bog'liq
(Head Up) Kathy Sierra Bert Bates - Head First Java, 3rd Edition Early Release-O\'Reilly Media, Inc. (2021)

public class PhraseOMatic {
public static void main (String[] args) {
// make three sets of words to choose from. Add your own!
String[] wordListOne = {“agnostic”, “opinionated”, 


“voice activated”, “haptically driven”, “extensible”, 
“reactive”, “agent based”, “functional”, “AI enabled”, 
“strongly typed”};
String[] wordListTwo = {“loosely coupled”, 
“six sigma”, “asynchronous”, “event driven”, “pub 
sub”, “IoT”, “cloud native”, “service oriented”, 
“containerized”, “serverless”, “n-tier”, “distributed 
ledger”};
String[] wordListThree = {“framework”, “library”, 
“DSL”, “REST API”, “repository”, “pipeline”, “service 
mesh”, “architecture”, “perspective”, “design”, 
“orientation”};
// find out how many words are in each list
int oneLength = wordListOne.length;
int twoLength = wordListTwo.length;
int threeLength = wordListThree.length;
// generate three random numbers
int rand1 = (int) (Math.random() * oneLength);
int rand2 = (int) (Math.random() * twoLength);
int rand3 = (int) (Math.random() * threeLength);
// now build a phrase
String phrase = wordListOne[rand1] + “ “ + 
wordListTwo[rand2] + “ “ + wordListThree[rand3];
// print out the phrase
System.out.println(“What we need is a “ + phrase); 

 }


NOTE
when you type this into an editor, let the code do its own word/line-wrapping! Never hit
the return key when you’re typing a String (a thing between “quotes”) or it won’t
compile. So the hyphens you see on this page are real, and you can type them, but don’t
hit the return key until AFTER you’ve closed a String.

Download 17,18 Mb.

Do'stlaringiz bilan baham:
1   ...   9   10   11   12   13   14   15   16   ...   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