Java Notes 2
Java Notes 2
Clogs Test
int o 100 b 0
desoniption
Dbjeet
Reepion QoBe
deseriptio) onuadly hondle
stoek tso ce
coteh
hond ter inay
Pojot
demtnates nomally
the aldergn ate woy to eoNR the eeepHD
Noma Terninadion
20md by
ovda od
zem :/byPceptton Anthmait long jouo.
ro) dividle connot
by s$O"
you syso(e);
|
Ssysolj
20,2 b00, ae nt
Test clagg
ute ee otll
toy in
tin emeepion istheme
la<k 2oteh ode hanolir I/
loseName CAoeptlon coteh
nome)rotvo.
tode isky Il
oxeeste block (Aay
olooys)
syrlo
cadeh fHry
Ooy to cosite hande code Oe stotk priStock
doss TRst o) Sop2), Sop(e.tos
22 o/6
,Syso (e
cutehcArrithmatzExeepion e)
e printstoek rae (
(O:) o r
osld dshos Syso (e) syso (e to strngc); some
Syso (e.gedmesayel
death ot thoneod
se-> Conneetion lose(Oadabore
Logneleose eleoge
rfnaly
9mrsligeos
CAhally Slock will epe wte oldys)
fd Co
I omtnaly s'ock
lorz,Anthmeor
bobroe
Anaily
noh201
eNLPAio.l
User detne
Hod to thao <lossNome Eareption msq}
thoow
s blds ddedt
on
Z)
thro ned
2
noh ellible)
Unchecked eceAeo Y
ehezked 0
o we con hooa ejthen
bnly dhnw loss th ad comes in thooebe ehJ
we
osite ony stotemeot ater tho Dhernse
We connoft errs
jt psouide vnregchable stetemet
Hibemate
Aoooylist Lin
Ale tondling rlte dodo
deAiney how e on oeac al the
* Ale hondling soNg o pozkage contan
dasses
Dn o
a Ale output
input
thoough whleh e ton perttoy a
opemattony în tthe file
seguen ce ot dado, on the baais at
stream is dedainto 2streo
elagses
jaNdO poekge al) Ahe
the a9se
horeten
lengdth )
* le Hondry elossey
fle Qutputttregm
) ButeTrputttromn
AtenrOuteutstmegn
Operractton_n le
Coeate Ale
intormatto
getfile
9219
clocs AleMethods
throu TOLepto
Nojd oreateAileMethod (string patb)
pile f new Aile(patth;
lse
Acreade NeudfiK}
Syso' Ale scoeated sULSRL1dulb
Padh)
int i
syso ((zhor)i)
2bsta
Hasktable
Hashtae synchryniseo
O Hochtable is
Hoshma is ron gynchsed.
ttoshtable doesnd atled ary
Hoshmop_a los one nul key
valees. nellke o Nalue,
¢ meHple null
slo
fost Harbtasle inhend o)tooy
Hoshenap inhet Atboodnap elas Ja.
nged.e threadsade.
Sp memey
I¢ we ekonealae Tt meons tuo thread Simuienash
Lontt cad de etteds ) sliy Builderi
to mybatten
Comeile Hme eyeepMen
Ru4}me en2ep46r one the
O
. omplle me eRepton meony eAeeptery that or not eheo
whieh one
those eeepanN
zheek by ompiler ad compiledime
ehebe pragrom
In compìl e e eneepa 20mpilRs ne beeouse the
prrqrom Qveg omplloaione
Aametho thooe
Ahe2eponE
methed
st Some cade costhin uneheeked eeeptons ges
thouk ehesked eaeeptlo) tte
mogdly due do prgromy
the method mt ther handle mìstokes
peelty
the epeepttoq cot muet They are re subdage
te ehonees otfaûlwn to hh
ohen
They but do nt
nhenhom unttmeenzeph das
At core Jovo Notey
Oith s poirt on e0eh topie
de
eloratof iot oa16 dedinidion
) dototpe
To aeprese d ata in memor de
We con Use dedodype
To gRpresert dyee ot o Nonable e eo9 use datote.
dato tyee dedeg the memory
datope dede the onge ot Nalde Jhih ose store
datodpe
io vonable,
joNa, primitue Non pojmive
T0o type ot ooable jo hom booteon shost 1eng these these ore
double
A drs c înt, byhe, tHoad, eloss ee these ore pon-m
poinitve dototpej. Anoy story
Aloot byte, odouble lory to &
a iot sequlred 4byhe memor
aint
byte t r buoleon bit t r short
tur ehon o byde, ter bte
ebrte ot byte short lory dado by pes detout Nolwe is o
Aloat f dovble detoult olue i ehor t bolesqpdfoleh
(Rores- iotnbtoeb
DktRR, TY
rt is used do develop, modihy jong opoliatis
Opers adorg
O pesador /s Syobol tha is used to pestorm opesd}ons
to user oguioe ments
oine eoly dyee ot opersodo.
GAsithmatte Reladonal 1ogicadl
logeeal Aeslgnme Onosy Aumory
Amithendie opertos ann wse cto penttomm omithiadte
dpssstiagy ike AdlitHon sabthrocHo mwttiplfischoh
Relattano Hl ang used to check dhe meladanship betleen
If TArelse
It-else-ib-else
Sope block ot code on he bosis
ot condiog eult tteyS om qoy It stedemert
I Wont to eeeute sme blok &A tatemernt on the
else~it bo eheek
block o)1l eeute
lseit blok tolse Hen eJse
whle Jop.
S) foslop, wkile do on the bosig oteondih
epeat some blozk ot ode
AT s dontto
goly t ue for lop
om
code otleat one w)thut
ot
ent oto enRcute ssme bjozk
( Class
6 doss j d tenp lade os bluepiot Arom heh ob)« ore
Joss is
Jass
Jass deenine hcud objeet behoe cohich objech lt ceotern
ohject
cbËeet it on inghonce ot o dors.
phy ical ati.
dbjech oeguirsdonmemsg
et,ch hane stedey Lhel beh aye
Dt data metthods.
dthere
keybord by usly ned insone medhod clas,
by uslrg neD method ot oneator clost
by usl ne inotonce
usy elone meth od ) by woly desen 2tis)
by
() Referene Yonì able,
coecon uie
TO aeees_tunton allt ot on objeet
Tt ol hold eterence ot on obj'eet
Retusdype
alie is caled etun tyoe
datoype ot tte etun laue
returtpe
fuesz oethod inn oNg is dedoed ith o
A netumpe moy be o pri nite Aye like int tead
ouble eteence type
be
The type ot dato etumed bya method must
compltable with tte metum type speided by method
The etum tyee meguired un teement et te
end ot te method
Con tncthor
Jnstonee o)abke
foo eoch objeet 2ogtruetr Ot! eyeeute on ce
congteder method Which awe not ary don
dyee nehoiy Noid.
G) Ohen coe ereate an object ontveter 0!! wtomette
Supes keylord
keyQord thect ter to the super dag insfonee
Super is o
membes
super key Qo holds he otormatiog ot Super eloes.
Super keyL0 osd is used tye ohAterentiate betee) superelosf
nstonce menbeng subelass nsfon (e nember.
USe supeskezsoend inde stet'e bfotefmetheo.
GtatetQUper ie non-stedi na etereeoable.
Se
((9) bloek
Time con tumny cde e eon Oit nde te b<at
shotie stock dests wth Jay f nttonee block deals artd obse
tonee oek ao ecte Shen
(20
clocs hedore 2onstetow eetwtfon stetie vomae
Jnstde otadie Sock cde co) alvels cnly
(inside jnstonee blotk de toF oceelf Intonee I static Yon
black
ty Botk exeute alajs.
i
A theme is expeetBop ocewm in ty block tte codh block Oy!
n) pokaye imporch
O pockaye s oo slmple tolder
poskge js cotlezthy
colleztiog ot Wosreyfototoce
wotsey
ANeyy elasf f inttaoe the part atpoekre,
out be pockye stetemeqd
njonoprogrom frst tattmegt
pockae statemeF+
pe coq orik atmest one asl Jossess,itotoo
to mport
import kay coamd te used
-le fpockagA
model thod pooujd
objeet.oriente pDgnomminy is ainhestene bsfrgtio
dith de ey ot concepdye
pblg morphism ecapsuladta9 thege
ente
cbetorient prognomm)y is o methodolog to desiqn o
Q alosseg objeedt. smp lidses sothaar
prograrn usly manonohee by_prouldy some cancepts
JeNelepment f
Bke objeet closs
Tnhertenee,
O The process Ohere one elogf agure cal! propetey metho
of another elq9! calle oheitence,
Joyg Suppont sngle multilere/ p terenhie iohentenee ay
SE7 tetoce
nutabje unordered heteregenja callettoq
ot elemends ohene dupticodtop is oot allod $inseran
onder yn not be preseNed
) Se stre dato yeao diy o the hoshcade yaluey.
Set con stre on
con qet set elemert voy iteraden
3)Tree Set
Treeset mpleme stko do of Nagigeble set donolk