0% found this document useful (0 votes)
9 views

Java Notes 3

Uploaded by

Ashu jadhav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Java Notes 3

Uploaded by

Ashu jadhav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Lioked Hashsef

ss ao mplemertad doss ot se
o Lmked thoshset
mderdae, Cjanuutil)
senthoakle
Tt ertends Hashset cJoss.
duplleotes yadde. ol| molnten
It o)ll not a |aD to add
iosortto onder
Tt is oonynchoonise clost.

(3) Heosh Map. CIOk I.2)


ttoshpr jmplemendee
Dhieh )s present inoa, u potkaye
te tash af potends Abstoaettgp los.
ftashmap j non-yrkonised closs Cadot tredsade
Hashmap comtaùns value bosed onthe keoy
T may havesiylk nat key r multhpleOtl yalefi
tlosh map dorenot miten oder
teshmep js os'e lompore to Ioeemap
( toshmap sos4 the hoashtebe

Treemapis impemented lasr ot soottne intodace


jaya udtl,
Taeerap extends tbstroetgge Josp
elarf
Treerae c9o'cny yalwe bored on tte key
Treea.
null key but ha4e multipte wt| y a s
in ascen diy oder

hayh mr
Tt nomy se
) tjobedtHasht ap
jmplemete elast
Lnked Houhmap
9.uil.
Oeh s present injaN
Tt eptdends tfoshMap elas -
Tis nuynehaoniged <lag
combinatian,
T stoe the yalwe otte key-pedr
Sfteannot hoNe aluptieade eJemet
Itmoy harte one or multiplk nul yalay
oull ke
tt c9n be marnden jngertto) eode
) List Tnturoce fethods
O add e tpeends tte epeeldied eJemnt do tte end ot tit
Tt corl setumm buolkon
add (int indag e) nseroh tte speihed elemet spe ihe
posiiog (meetum ojd)
a addAI/ollectton ) > used cto add al/ ot otte speidied elamert
to tte speelheo collectio9 (metun beo leon
addtA Cirtindy c ) used dto a! oft he spe tdied elemen
to dte speithed coleaten fseeei hied pozidio, bunleon)
deon method use fo semoe all the elemen
fon cetetiy. (aid).
6 certas (objeut o)’ cheek dhah objeet is peset no
Cboleon)
qet Cint index) - Returg tte elemant at te speeihed.
faetnn triy)
hoshtode Q eetumthe hoshzo Je yalhe r tis t s

a indeg o(dbjecto) retuan the ndey o ctost oceuonce


metumtne
(bolean
Remeye dhe element atthe speitre
e moye (ínt inde ) ’
positian n this lit. (Retum triy)
) oemore (obeod) (eetun beole9n
Remae fromthis fist all
elemeot that
that ame cortened in speait colleatte
CRetu baleon
(D set( int inde sty element] Qeplace tte element od specitie
retunthe numben ot element inthis (ist
Cotun ict)
ll tte elemerd o lrot
retum objeet IT)
iteadT () Ketum an jterode wer te elemet in tir lît
metum
steiy)
4 sublist Cinttrom inder,Yotto tnden )

(3) Hat hrfable


Hashtasle i's a jmplenery ciosi of map jotetoce
which ir present in
ig joNdu uti!
utt
Tt atends Ditignory elss.
Hashteble dosent ala
eloss
Hastrtesle is leya loss.
M) mettods ot set sntgooe
method Nome Add the pealhed eJemert to
addCstriy) beoleon
not presyt

Adds all re elemerts in

add AI(olleute) this seti4 thay ame not


already present

set coteung the


Cantoing (ob) et o) spe thed elemegt hulesn

is Emptc] Ratum t e if set buolesg

Pe moye tte speeiie


Jemet om thy se

Rernoes om is seh
aJl ot it element thet on helen
Cotcne d mpez
etumg tte nombe a

jtemato) c Retuns onideratoNer the


elemet nthit se

leo) Remove adl the

Retum ue maf
(ontains key(o kg)
cantan
speshed ke
bualeeq
(oaten Wase (obj value beoleop
Map corgtery one
keps fo sSpei eo valve

equ ads(ojeto) Retum e i the give)


Objeet is also o maef tte buoleoi)
two maps repser the some

Retumte vadde to oheh the


get (objectten) spedhed îs mapped
retum the hoshtode
hasheodecO Nalde fur this nap

cotlny ne kay-vave
buolesn

put Cint bey , stiy adugd Asoiaty the speiheal vae


Dith the spetred bey 1n

renawe Cob) key) Remossy the mapply ke


wofrom this map

eplace (irt ke, thiy sabe) replacay tte entyt


the spe ihed

to ome Nae

ertyset() sedvieso otthe Set ty L

kylete) keys cagtcàned


s naf Setlintegu
bs
ba Colle ohion Lstny
ya/ueg() metun o colle atto
evaluag otedne in the mp 922

scou n at he gunne that is


A Ao unexpe eted eventt
ONh
pngrom that inpt e non
duciy executton of o (Abngnca/ terninn
progron is caled exc«ptiog.
eetiniy -llesdtenadtie
detiniy ogs to me coNe thad egr ceptoq_/s
calledd ancePdBon hand ny. (oiormal tenmtoadtion)
ecepton cum beeouse of poqro meg

Ther are tue pey ot eneeptto)


complle dime ceheeked eneeptiop )Punttms Cyncheckad)
Thoable s
dowey

ceuns beeouse of loek ot . resouRes,

Tpeo ern

Compilettme eyepto) mntme enceptHa.


cotshzdo Oeh ame not he cked
Oeh arre hekked by
(ompiler ad copila dime, oc conpi letie

be couie compiler ootabe


comele dime esLePtog Ldo eheek thac eeertiog
cheek eneeptis90casm 9 uncheeked ezseeptun
Dhen honce bt feiredo Hgh
-misto kes
Leptog 9s but doqad in henh They ome giret çubdoer st
f n t t e eceptio
COmple ne Quotine epephe)
eld ore
eM.dossNotfound NoSuchthethod Oclosslost
IO Byteptsn SQLeeeplo ONullPo)otu
Alesotfound ) RoPAeePhio)

OTry blek alQoyy eeLut

O tbstroztion is the proces ot hdiny imple metatton defels


rom te se
te
see tte d-A. Aunetion ality sptions (
Ojthdro, cheek bal, choye plo prou) ded o Ar soreen
but cgnttsee the actua prosom aeop <fo n thety doncn
Tioo os to aehiene abstroto9
bstget <lass Tntesrtace
49 Phstrott eloss f gbstroet hethed
cJass hieh contdn abstraet keygord jn iH declarats9
Abs-sot dasr
Abstrot el9ss my or my not conteg oubstrat method
De eof a hiene portial absto etion bry usiy atstrast clas.
4) hetho oithoyt bod is caled bssadethod.
(S9It he Jass hanly atleast one ab stract method then De
hove to <smpulsop datine lass

iny'emetad?s9 to al abstroet methods in ehd dass


we con not Coreate bbjeet odh aberot yoss
atevdaee yldipe
lemet onp superoJ
lPyh GNe
fsrtroet thol hecu cAteble more Mrtace
abstoo sonplatt 4Dtentace
is
lemnert onp elass
t ster an
eten 9n dass abstra
iaheitane sìgle o nhemtone
tous< be2on odegoce Q
member 000-pb'
ntea
onab'e non.tina tine stat? be st cthet
metthod. cancrede
ethoda
O codalns Tntertae
m
elarsGbstroet Thtertae
0jtterene 4)
cantalqpublic
abtroch inttoce detault B
nethod. y )
pub cotwn ntertoe deteult
ñeble tstodie
in
nemberg intonce cotedn not Totentae
Lon
20nstter coea nat does tertole
absroiap coeeee
full oetetoee us)y
etiar. abstro aehere om
foUsed Tàtemtocey
ghat o
ub methods he
dyee stoet TNentucey
houy but sjmilor
o doe
ntente
cloy bstaet
unlmplemetrd entttj
|ly du oorld meal
do3.
Jos.
4) ncopsulation
ude the dado behidd oa method is cadleed oncopsulatioo
O
3 ncopsul atlon s qooup mothanisn hee We 29qrup o
N9'obles ¢methads into slle unit callkg los
elass s tte bet epromple ot encopsulatto

te com by pressy stort button otena ad etels of


sharty operadlon
entire stonty procesi is adden om yu othenite uc
tel stany sReratto9
The man pumpose ot encopsuladiog is Oato seunity
Oata hidin eg lmoky Noncbley are pivade.
0e c99 ahiene enaopsufadtorn b mokiy yan abey ang
pivate medhudr apubl.
ule haNe setten

O The protess orpoouidix nuitiple ionplementatag de a


pthod to pertorm pertia en tte boris o sub bA

pol manp!r
Compile dime
comeiletine poly ron phisrs handle ky lompilen
Runtime polymorrgism hondle by Taa
methoo averload iry

(só) eth od ONestoadiny


T4 the eloss han multele mhadsuith te some

mere gnethod muSt be ome ngme


elass. S1
dettae insome idteret amynent
be
methods muat haN
con be didheret
No. of oyment
0’segvene e-|
ot ony m
O ditderehredumbpe,
oyeruade nethyd m hane

tethod overding
ja child Veos js celle
poment doss methedls
Redetine
Method ovesaliy Gnethog ogme m fhe pore
hil os hao come
cnethod ovenhsome
diy poramecr ht as 19
hove
hild gs methods cnst
fhe paent elas f.
ThereÌS howiy poret
Metho oyeajdi oecurg io tuo lans that hoiy
eun t Pe
ament Jass mehods t ehild lo9s netho

(s Constneten Ouerloading
hov'y nele ontelon dh the so me
Tt tte cJass constnetn overoading.
but ditt. srgument ish is callRd
but dltycer must be 2or be d e
in gome losg.
gamethy
Constavctors must have deterent onqumert (ist.
o ot amqument iet con be dittemn k
Segyene ot omumet
type od anyunent
3oittemene oerloading Oueniding
iemding
Ouentoadiry ) Redetine paet dy mthod
multple
It the elay haiy
methods att some nome /S
oNenñding
jerlsodiy
Oversloaual eenton in that hauy Porenteildley
Method oemidiy he
9 Metho oenoadly is the edample ot unite Pdlymore
polgmorps
e gmpleot ompietine paretelos! methad ey
oNetoades method no hone
lass nethodg onwst have same,
same or alltt metum dyPe retum ee

Hidid
We con hdestod
O_Ingtonee Method eo
(nethod ¢ cdoba Nanable
methug
ONemy ) TA nethod Wdy
mett odresalutton boged'on
Compietfe poyno ym
Runtin pahmonpm

You might also like