Head First Java a brain-Friendly Guide Kathy Sierra and Bert Bates



Download 17,18 Mb.
Pdf ko'rish
bet41/90
Sana22.06.2022
Hajmi17,18 Mb.
#693704
1   ...   37   38   39   40   41   42   43   44   ...   90
Bog'liq
(Head Up) Kathy Sierra Bert Bates - Head First Java, 3rd Edition Early Release-O\'Reilly Media, Inc. (2021)

This table reserved.
_
catch
double
float
int
private
super
true
abstract
char
else
for
interface
protected
switch
try
assert
class
enum
goto
long
public
synchronized
var
boolean
const
extends
if
native
return
this
void
break
continue
false
implements
new
short
throw
vola
byte
default
final
import
null
static
throws
whi
case
do
finally
instanceof
package
strictfp
transient
Java’s keywords, reserved words, and special identifiers. If you use these for names, the compiler will 
probably
be
very, 
very
upset.
Controlling your Dog object
You know how to declare a primitive variable and assign it a value. But now what about non-primitive variables?
In other words
what about objects?
There is actually no such thing as an object variable.
There’s only an object reference variable.
An object reference variable holds bits that represent a way to access an object.
It doesn’t hold the object itself, but it holds something like a pointer. Or an address. Except, in Java
we don’t really know what is inside a reference variable. We do know that whatever it is, it
represents one and only one object. And the JVM knows how to use the reference to get to the
object.
You can’t stuff an object into a variable. We often think of it that way... we say things like, “I passed the String to
the System.out. println() method.” Or, “The method returns a Dog”, or, “I put a new Foo object into the variable
named myFoo.”


But that’s not what happens. There aren’t giant expandable cups that can grow to the size of any object. Objects
live in one place and one place only—the garbage collectible heap! (You’ll learn more about that later in this
chapter.)
Although a primitive variable is full of bits representing the actual 

Download 17,18 Mb.

Do'stlaringiz bilan baham:
1   ...   37   38   39   40   41   42   43   44   ...   90




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