Java for Fucking Idiots: Learn the Basics of Java Programming Without any experience!



Download 3,91 Mb.
Pdf ko'rish
bet32/70
Sana02.04.2022
Hajmi3,91 Mb.
#524999
1   ...   28   29   30   31   32   33   34   35   ...   70
Bog'liq
Java for Fucking Idiots

char
[] alphabet = {
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'I'
,
'J'
,
'K'
,
'L'
,
'M'
,
'N'
,
'O'
,
'P'
,
'Q'
,
'R'
,
'S'
,
'T'
,
'U'
,
'V'
,
'W'
,
'X'
,
'Y'
,
'Z'
};


int
index =
0
;
while
(index < alphabet.
length
) {
System.
out
.println(alphabet[index]);
index = index +
1
;
}
What comes out? This:
A
B
C
D
E
F

Whoa, would you look at that!? Here it is in plain English:
Set the index to 0.
Run some code while the index is less than the length (26).
Print the letter in the alphabet positioned at the current
index.
Increase the index by 1.
This approach of doing something in a loop, then increasing the index by 1
(incrementing ) is very common. You’re basically moving one by one
through the array.
Note: If you wanted to you could increase the index by 2 and print out every
other letter! Wouldn’t that be exciting ?!?! Wow!!
BREAKING AND ENTERING
Picture your Netflix library (let’s see how quickly we can age the book!)
You look at the first entry in Netflix’ list of recommendations. You think
about it, but don’t feel like watching it. You move onto the next one.
You repeat this until you see a TV show or movie where you know you’ll
enjoy it, because you hate trying new things. Once you see an entry that you


decide to watch, you stop (and break the loop).
String[] recommendations = {

Download 3,91 Mb.

Do'stlaringiz bilan baham:
1   ...   28   29   30   31   32   33   34   35   ...   70




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