— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet61/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   57   58   59   60   61   62   63   64   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

Garbage-Collectible Heap. When you 
create an object, Java allocates memory 
space on the heap according to how 
much that particular object needs. An 
object with, say, 15 instance variables, 
will probably need more space than an 
object with only two instance variables. 
But what happens when you need to 
reclaim that space? How do you get an 
object out of the heap when you’re done 
with it? Java manages that memory 
for you! When the JVM can ‘see’ that an 
object can never be used again, that 
object becomes eligible for garbage 
collection. And if you’re running low on 
memory, the Garbage Collector will run, 
throw out the unreachable objects, and 
free up the space, so that the space can 
be reused. In later chapters you’ll learn 
more about how this works.


you are here
4
classes 
and 
objects
41
 BULLET POINTS
ß
Object-oriented programming lets you extend 
a program without having to touch previously-
tested, working code.
ß
All Java code is defined in a class
ß
A class describes how to make an object of 
that class type. A class is like a blueprint.
ß
An object can take care of itself; you don’t 
have to know or care how the object does it.
ß
An object knows things and does things.
ß
Things an object knows about itself are called 
instance variables. They represent the state 
of an object.
ß
Things an object does are called methods
They represent the behavior of an object.
ß
When you create a class, you may also want 
to create a separate test class which you’ll 
use to create objects of your new class type.
ß
A class can inherit instance variables and 
methods from a more abstract superclass.
ß
At runtime, a Java program is nothing more 
than objects ‘talking’ to other objects.
there are no
Dumb Questions
Q: 

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   57   58   59   60   61   62   63   64   ...   555




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