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



Download 3,91 Mb.
Pdf ko'rish
bet40/70
Sana02.04.2022
Hajmi3,91 Mb.
#524999
1   ...   36   37   38   39   40   41   42   43   ...   70
Bog'liq
Java for Fucking Idiots

am making a new object out of this class. Bitch.
You didn’t need to say new when you were using the primitive variable
types like int and double . This is for the object-oriented shit, baby! Wooh!
New Book!
4. Book() 
4
Huh? Didn’t we already cover Book? It’s the type of variable we’re making
right?
Why is it at the beginning and then here, at the end? What’s the point?
Because you can do fancy shit with those parentheses right there.
When you make a new Book you could say “hey Java, when you make the
new Book object, make its title this, its author this, etc.
And that’s the wayyyyyy the news goes…
So yeah.
Book myBook = new Book();


More than meets the eye. Just like you, beautiful reader. There’s a big, full,
beautiful brain behind those dead-set and lifeless eyes. We’ll make it
through this together, I promise.
Let’s get back to the two parentheses () there. That’s a super special part
that I’ll cover with this next section. Coming up…now!
Constructors
“Bob, the Builder!
Can we build it?
Bob, the builder!
Yes we can!”
You know, when I went to write down this quote I had to look it up. It turns
out they changed “Can we fix it?” to “Can we build it?” And you just know
I’ve gotta be accurate with my quotations, so that’s what I used.
Anyways, what’s a constructor?
Bob
A constructor is like Bob, the Builder. You know, the carpenter with a
yellow hardhat. Cool guy.
Bob has a hammer, saw, screwdriver, and all kind of tools to build houses.
In Java, Bob builds the object (the actual house) from your blueprint (the
class). Here’s a sample class:
class
House {
String

Download 3,91 Mb.

Do'stlaringiz bilan baham:
1   ...   36   37   38   39   40   41   42   43   ...   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