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


boolean itsSmaller = 2 < 3 ; //False boolean



Download 3,91 Mb.
Pdf ko'rish
bet17/70
Sana02.04.2022
Hajmi3,91 Mb.
#524999
1   ...   13   14   15   16   17   18   19   20   ...   70
Bog'liq
Java for Fucking Idiots

boolean
itsSmaller =
2
<
3
;
//False
boolean
itsBigger =
3
>
4
;
I know what you’re thinking. I’ve got this in the bag. Those operators are
simple! Comparing values to see if one is bigger or smaller than another?
Hah! What a joke. This guy must think I’m a complete fucking idiot.
Well, yes, that’s the point.
But there’s some more curveballs coming your way.
Remember the “or equal to” bit I mentioned up above? In regular old math,
that’s when you underline the carrot thing, like this: ≥
You can combine an equals sign with one of the comparison operators to
form the same thing; a more craaaazy kind of relational check:
//True
boolean
itsBiggerOrTheSame =
5
>=
5
;
//False
boolean
itsSmallerOrTheSame =
3
<=
2
;
Sure, putting the equals sign after the carrot isn’t as sexy as underlining it
like you do in algebra. But that’s how you do it in Java.
You can keep experimenting with these but you’re probably already getting
the hang of it.
Yeah, I guess you could say that’s a compliment. Keep up the good work
buddy. Isn’t it amazing how easy programming is?!?! You’re so smart! And
a wonderful reader! Also, did you award this book 5 stars yet?
The comparison operator!
What happens if you put two equals signs next to each other?
:thinking emoji:


The answer is that the mommy equals sign and daddy equal sign come
together and form a new operator; the comparison operator !
This is where my tangent about how a single equals sign (=) means
“assignment” and not “is equal to” really comes into play. So I hope you
held on to that mystery mouseketool!
Okay, let’s say that we don’t want to assign a value to a variable. Instead,
we want to check if a variable is equal to a value. This is super duper,
extremely common by the way.
Enter the comparison operator; two equals signs, back to back.
//True

Download 3,91 Mb.

Do'stlaringiz bilan baham:
1   ...   13   14   15   16   17   18   19   20   ...   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