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


byte: A tiny number (-128 to 127) typically used for dealing with files. int



Download 3,91 Mb.
Pdf ko'rish
bet12/70
Sana02.04.2022
Hajmi3,91 Mb.
#524999
1   ...   8   9   10   11   12   13   14   15   ...   70
Bog'liq
Java for Fucking Idiots

byte: A tiny number (-128 to 127) typically used for dealing with files.
int: a whole number that can store quite large numbers. Very common.
short: a smaller int tha- who gives a shit, don’t use these.
long: an integer that can be hyuuuuuuuge.
double: a number that can have decimal points, like 4.20, or 6.90.
float: a stupid and useless version of double.
char: a single character inside single quotes, like ‘g’ or ‘f’.
boolean: true, or false. Nothing else. The data type of Siths.
You can Google “Java data types” or click 
this link
 to see all of your
options.
What are thooooose?


They’re called primitive data types; not because they’re illiterate and don’t
bathe, but because they aren’t objects.
Imagine the universe in Java is not composed of protons, neutrons, and
electrons at its lowest level (hope you graduated from middle school!), but
primitive variables.
A primitive variable does not have properties. It does not have methods. It
is not a blueprint from which we can create an object. It cannot reproduce.
You cannot get more basic than a primitive. I mean, look at them. 
char
is a
single letter. 
double
/
float
/
int/short
are numbers. 
boolean
is true or false.
Note that all the examples I listed start with a lowercase letter; this is the
tell-tale sign of a primitive variable.
Every class or object that stores or processes data, somewhere deep inside,
has data represented by primitives. I think. Probably.
Any piece of data that you see represented as an Object is using primitives
under the hood. For example, there’s a class in Java that’s extraordinarily
common called a String. See the capital S? Not a primitive!
A note on Strings
What’s a String , you ask? Literally anything inside of two double quotes.
“Hello, world!” is a String.
“ “ is a String with a space in it
“” is an empty String
“123” is a String
“598.23” is a String.
This entire book within some double quotes is a String.
Secretly (okay not very secretly) it’s a bunch of 
char
variables tied together
.
The String class takes care of all that for you.
We have an entire section of this book dedicated to Strings, how to deal
with them, and all kinds of garbage like that later in the book. But hopefully
this will tide you over.


Experimenting
I recommend that you experiment with declaring variables, giving them
values, and seeing what happens. You can even boot up your stupid “Hello,
World!” program and put it inside the main method.

Download 3,91 Mb.

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