Java Unit1 Notes
Java Unit1 Notes
Con Cept
Data abgtraction
Data EnCopsulaton,
. polymnphigm,
. Syoamic
Bindig
Communicat'on,
Mesrage
1. clas
tollection data qod
maniplate data,
membe un etiong that
and
data qre called data menber
Called
vanable de claratin
encti'sn doclaration:
2, oboject
An obiect Can be
dafired
adde
inS+ance a clus. TE
Bone meno spae,
Qnd takes
3. Ab gthation. Proers uwhich
infimtn and
the nood
intoy maon The
hido unnearg
ma
4. 'acap Suhtion
a
Ihhentane ctases
The doiving ne
clas re
tom eai loy.
called b s tauses and inheited olales
Called derived alases,
mor phiern,
nd
means many
po'y polynorphiDm mean
than On toro
abil;ty to tak
Binding
eolveol t nntime
method jimplemna tron ui
called
obs'e
mih onented ohiet Tava
an
.objet
wner toeogy qnd elean Simele
to
Simde
Ditibute.
threaded Nuli
tovmane. Per High
Interpreted
ral Achitecture
Neut
bust Ro
laderendent Platyoron
A
tae Por
ented 0 obje
- 2.
Simele I,
Features, Tava 2,
n). meslogeCtn e"nam obsret
tiot, receiviny
n Co,din| hy
r each with eates Conmun 6bject&
pagsing
MegSge 8.
foyiable
Poytable be Couae
gava oytecoe to
tacilitalet Cary the
ng Matm
Cune be C a e
Tara Qe
|.
No plict poinher
class toade
byte code viiter
Ro bust
Sava Compler
, tigh Peato manne
thon
Tava
java byode
pegiamming nge
notve Code
close to
Hwtithrende
han ne job ot
Handling
time Sqva
m t
Atbreodin
4. idvibuted
dietibke beCue it
Sava
ereate
oli'gtnbed
Yacilittes
peliatons
Dynamic:
Dynamic lan guge Jt
Sava
dynamic
loading e elases.
2.
Interpete
Tav a
boh Compile and intrpreter.
taye y81e
PogTm
Cvauthg ad
Praa
1. Creting the
4he progam
the
J Running the Prgram
the Progam
ying any tet
Create the Progrqm
tpdpud Then
eitor Sueh a noterd by)
whthe Etes Java.
Stive the pngtam
lename. Gavq
Program yqv
Corpile the Sava wing
Corpiler.
Syntax
tayac tilename. javg
whare
the Jqva Cornpiler
Java eatenson
: Aith metic
2. operatr
Relationa
operaor
4 short hand Assiqnment opetor
Increment decrement operaty
Condit'onl operator
Bitoile operatr
Specia operatoT
Neltiplcaton
Divisioo
Mo dulo Diuil
Rlaton operatYg
uyed to ahee,
These operatQ
oferan d
the ionghip
velation ghie betoeen
ope,aty 2egult
Wot equal to
gTeater than
7
les than
qreatex than ) equa to
les then os equal to
s) togical oPeyatr
operatur ane
we to cheek
These
whertie an epreSion
Operatoy
togikal
Lgeal
logial
logical
rort hand Gssignment opa ator ,
These opera qe uyed to Rimplit
the
ouding
t aternent
gmple,
OPe, at
ae b
)Inee ment nal DoCeme
\ncement (+t)
tho valu bavaab.le
Dece ment ( - )
docement
b
Nean
Condition a oPpraor:
6) Condlitonal opesats
the
hal
Eondtonal presi ons
to build Simple
three oPeYand.
Stntar :lapresion3
Exprelsi
thee, then
&presionl
ne Conto) movel to
Conto novel to
then the
Bitwie operatoI.
hese peratrg wed o petn
ogic qate! bReations bit by bit.
oPeratY Regult
Bitwile
Bitwise
Bitwe Right ghitt
Ait wite dett ghitt.
Complenent
s) Spe cial
Instan ce
twed to tind out whetha
the
ien obiect belongs te artiear clas
Dot,
Synta
hiectname t'nStance las nqme
Dot C")
Tt wed to access the va abke qhd
hside te
method els
Lo yava variables:
The name iren to he menosy
[oation to Rtore
Rudes
Variable &hald be tmed coith aleabet,
digit, under Seore qnd dollar gmtaol ogy
kepoord.
ð The irt erate mut be an alehabet.
lo wey Cae lette,S
louwer lette,s re
4. Both uppe and
yed,
claving vanabra
Int 4, b,C,
Synta
variabo name vales
he deelared variable
variablename - ahreay
vele The value to be aasgmed.
Tniiing aiable4:
inital valee to the vaiable
at the me et doclayation
Varialle vle
datatye
int a (o}
Defnull valieea: declare but no
Vaviablo
the ives
iniialied meant
Datye
boclean Yalse
b¡ he
har hull
variable
the vlue et
Scepe e vanables,
OA Variable known
mean A
the
arneng
|. ins tane Vanable
Vanable.
3. loalyqiable
blouk Vaiable
I. Snstance vaable
These vanle deltared injde a
las, TnStahe vanables qre reated ohea
oby'et 4re eroate.
2.
lass variables
these variables are deelared inside a
vanabley
clas oth he keyuoor d ghatc, these
reated by the ay
are ComOn to Qll e obieet 4
3 (ocal raiabl e
Theye vaiables Qre decare ingtde a
Thes e rarables hae
huncton lo) method
hun et'on.
only oithin the
vanable
dectaed
These vasriablel
Tava in Saro,
inelit'ual
token iy an
the token8.
wying
TOkene
Contan (or) iterle
s e a t , characteet.
eparator s,
key wordg
oord which belon to jqva
The
have Preditined megnin. Regurd
tonguge They in loecade.
oritten
should be
3. Literale
the Constant
Named that iven t
Congtant S.
Conctant&
and So me
Constqnt made up
Contqnt:
Point lonstant.
oating
Constant
(onstant
made digte
pointS.
olecimal
Tyeed Contqnt
b octal Contqnt
2. Characte
onstant
Shgle character lonstant.
Back Slayh eharo cten eonstan.
\n
9. String Cunttant
Sequene
uotartin,
Hnighna \e345
Exres Sion nd yalunton pretsion
I, ith neic
meli ere Sion
2. Relation apressibe,
a tb
2. Relational Bpreeion g.
Thege tined by relational opeatorg
Sthtax
Constaat
Constant Relationl (or)
(on Vqriale
Variable oPerator!
Speiion,
Agmeti
Erpression.
(atb)
Coikal Sxpreiion s
These
tmedby logial opeyatg
Syotox palational
SpresSlon
oPeyator Cpress ibns
(ayb) 2e
rpressibns insid
î oloeL all the
the paranthesis (o).
c).
T+ doed unay opertion
& TH doe mul4iplrcaton, division, and mod,
1 doey al additio and Subtra thon
the odo
2 does all telatonl nd lojical cerati
6. tt oloei
oPeratbn 3,
Is) -2 t 3
|2 C15-10 / ) -2-3
c\2%3 -2-3
|2x&
g6 = \sl