Professional Documents
Culture Documents
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
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