You are on page 1of 5

Savali krichha Bhorqm

KollNO:s8, PRN: I03222 | 19D


PanelA, Ba+ch A2, SyCE

Proble m Statement stud o cOlle ction Prame


work n Iata
obiectve Lo.ctudy collecti ons Lo Jasta
the e
The0ny Taxea pDqrams to demonstrate
ist
of Array stvectoY StaCEHash Mapinked
Attay ist Example:
mport java util At raist
public class ArraytictExample
Lpublic static vold mdin Cstnq (I arqs
Actay tist Lstiinq fruit s E neo Array ist <stingo
feui ts adld (lapple")
fauits addCBanana")
sustemutpàntln (Arui ts :"fruits)

Ne ctor Example
import yava ut J ectDr
Lpublic static o)d main Cstìng C args) J
Nector <strng an mals nee Vector xstrl n4 >
animalsadd ('Doq")
animals sadd CMCat")
System out p£ntIn ("Anima lstanimals):
Stack Exomple
import java:utlstack '
publi class stack EXample
public Stati Vo)d main Cchi nq C]args)
Stack <string) namesneo stack KstinO
namespush c"ni ce ")
names psh C"Poxas")
Aundaram
`ystem..ot pàntn ('Nomes: Tngmes);t?
FOR EDUCATIONAL USE
Hash t1ap txample
impoct java utJ Hashmapy
public class Hathmap Example
public static NO)d maùn Cctång carqs)
Hashmap <stin Inteqer ) aDwOG eiEne
Hashmap <s tìm rnteg er DO;
aqespt c"Paras1,25);
agec put ( Raut"3o):
Syctemout println ("agei toage)
ConctusDn: Thus, e bave successflly studied
the collec)ons n Taa

lalhatjs cole ctì on n JavQ


Coile ctt on i n TaY Q ts a frameiworC that
provides an archì te otu re to stoe and mani pula te
agroup Of objects It provider interfaces
listset,quele ohich alles uito store
elements and perform operati Ons such as add
emve an searh

FOR EDUCATIONAL USE


Sundaram
Q.oDìffrentiate betuo een Aray and collection
y Array is fxed si2e data Structure aihite
COWeci on Can dynamically
Shùnt its s)2e
CCLn Store prLm) ve data tpes and
2)Array
ob)eCts athil e Colle C onS onlu sstore

Objects
accers ed usin4 the i ndex
3) Attoy can be
Lohi le Lolle ct on prDyìdes
aceess and nanipulate the elements
4) Aray are more memD ry - etfj)en t
than colleron

undaram) FOR EDUCATIONAL USE

You might also like