nde #4 a
_. Assignment Ho a? nye
Collect ons.
reeset
ingle unit of Object = 2
Frame cork provide ready “made -Archiéctarce
o_set of olss/ Fnerface. ©
[Explain — Vist “coutection © is kao A pes awautier
if , IY My
t inked ‘st_tolth example
I The list ¢) method _ oF Java collections class 1.
|| the used Pay —to_ge} —an_onray ist “Containin
ithe . elements’ geliirnec|_ by the cpeciied
Lenumerstion In the ocley in -Obich They ove |
— —|Selurned by the enumeration, ag
D Array Wis}— - : iewey isa
——j+Prsoy list is _implementec) Bom the lish interface
a He Fb uses < the dynamic omar Store so cluplica
= he clemen+ -of ohPferent__dlatatupe _ i
E Le SE matnjains fasection order in a man
4p Gurchronize manner te, we con_add€ vemeve,
—Rlemen}s any there __AS coell_ as element Con he
| acre ssed ecoadermly
DR EDUCATIONAL USEB) Linked Vis} — :
eLinxed Jigt implementation the
Yt Uee: oloubly Linked 1g
I the Clepnent
CONech- ff osing
| c vate, bet DEF, Pgs)
| Example of Uist € linked us}, Inserting
I & deleting nents in. thor 2
| FOR EDUCATIONAL USEInked Lig} ~
za Timp fave tall ts :
FOR EDUCATIONAL USEObj
of
= " OP ss €
|| ny ; ——= eS a —
—— ~ OB, put C" Naga”, oc) 5
i Obj. Fok Cbune", G00) : - =)
| bjpubC" Nashilx”, 3 5 |!
j ili - Temouet” Nagar", Qeaay—~
‘oN C obi
= TEED jstem—o ej)
{| =
I
j=
— Eo =
Ie on | =
I eo : the implementation ob
orcley,
a
For epukaTionaL uStore duplicate lem
alove oat the most ome Nuuy
nlitine an Perm UWjava. Lid
class —_fiashsel-ey ‘
t ; t
public slatic Noid) med. Cosipg. fa.
< 7
x ‘ atte
Hashsel--sel-s me
ite ° } G _4.5shing>
c
seh. addC 'monday"D3_
set. add C'' Tuesday);
gai cold C'ednesday 93 0
Seb. cid C Thursday); =
Set acd C Friday") ;
rakor Ashi lifes Seb, Yevertorc) > + e
bile Ce, Shasnext: 0)
System. cut. printin Clix, next ay
ss
Re ‘OM: E00: oe
ses Vor qreeo
TEC Map || -
oan “P usenally toe
JOVe collection
colledion — Hhay u= import Fou OH) = #3 _
| Cla: Txeesel
&
: C
Treeset Shing> eb =. Tre
veest : i a
Seb. add CM i
Ok adic" By
- seh. adel C" Wednescla4")5
pnt v seh, add C' “ABursdayD}
“Mevater i ity = seh HeratorO >
cdhile (ity. hagnexto)
fe
if z naa
-€ || Explain Comparctey__interface caith ex
SJ) is_used 40 _order_the Object of _u e
BE wicisseg nw se etdh ew hye 7
|. st is Capable of Compaling. kno obi
Same class, we _
\ythax—_ public int Compose Cabject obj abject obj?)
|
SHBBSSO Seo. a stale £
4 Using _ Commenter _; “we can Sart the eleme
is ddta _-rnembers =e
| < ; :
~_ provides. in din \ 2.
provides _cnultiple —s SCTHNG _SEGUENCES 4-8.soe ble
sips puclent ————
Fok 701100 } a
[| “name, dddy3 —__
| aden Cind yon 2 Sing,
Strip
rc =
Sree rans
this. name =name;_ TE
¥ this. addr = addy 3 sil
bit String toSting © —
teturn this. gonne "de
7 ae thin addy 5 —
FOR EDUCATIONAL USEClass, Sortbyname _\mplemenis Comparator
Et me Q-name + Compar Ch nomex
Te otodent
public___Static id main CString axgsr)
+ ;
: . Brea List4 Student> obj =nec
—Arsaytist 03
Mb). add neo “stadent oni, "ARC",
-ebjadd Co," x2") Mneideu"))5 »
ebb). dd C109, "-Soraatel"' Jaipur 'D)5.
Sbjradd C109 ,"" Aqgareoal”," Hoagyeng" js
System. Out pyintin C's. Unserted <2 -)3
© Povcrnt feos
\ Seate bu rallno "5
i (, AIZE OS |
Sov Cio is0,.1Kob}, SIZE O.5 jax)
FOR EDUCATIONAL USE:stem. out:
“sh Ses rt. Fas ol eerie
i a _
San Hevater interface ariows use _acce
—_ Iblemerit: OF the conection © jg used to \terahy,
over__the Plements in “the _Coilection_¢ map. lish,
|| Set
Sjerater i$ @ universal jleradoy it-con__®
Tne Cipplied fo any application.
traverse in foxword dived}
ction
SSSeak: or ones ist }ileratoy,
emo —
; ces ae
( ZL class = seale-_—__—__—_——
FOR EDUCATIONAL USEkick lerhed
Wei
fo ne _syslem. aout. ion City nexto):
a Tyson ou pa
- —|-——3}sem.au out. -puiniin C'Afer remove ist 2+
Povlig ‘totic void, (ese bing args mp —
Dhan
Linked list As String »
Wsts adel C" We come"
Mote add C “howd 5
W94+ add oc" Java")
HS git: add (" Tectuiens ———____
stem. oud. printin "List is: "-tiist) 5
“sera OY AShring> dy = Vist. Heratov 5
while cy h,
neon Linked Liste);
ly. semove 3!
ligt),
4
4
@SsilExplain lis) erator _iniesface_with example.
| There__16 No Current _element_in_a_\ist_ileratoy,
Ie is used sto _}waverse eal types oP Nt includin
Quaylist, Unked ist Stack it is available Rrorn ~
Hang \:2-
Le “Supple fidsetenel dogma ———
“its cursor always lies bet) previous © mex
~ FOR EDUCATIONAL USE.ex-_ — import java sted) ao a
[pune East
—— - List< Shrine obj neco Arxaylist<>05}
: en Ob}. -C"twélcome 5
a —P et {objet
_ | _ “ Od}. add C" java: a
=a}
is |
— Sy System ut priniin Cite next ads .
Q ce 709 amm in g "y 3
[ ——Histe ste