JAVA Assignment - 1
JAVA Assignment - 1
Sulject:dowa
1
Name: KBhuwanea
t oamd enplain dawa buwcids in dotasl Roll.No: 2226IA6624
ANA bwspeidA are
3ntopidad aud hiata pexkuurnta
Mmple
delaut eunel 8Osbubulid
3 Rebu 9Dymamuo
4 Mutti-toaded lo,eci
S dAcluteclune Nutral t.Porkakley
6. dLenguMy
to be ounce
ject euietzd aNa o mol'dengnad
Cpo Compalbble t h any oMi Aamguagi.
tis
cempleolinio
n me comp ,
do prioduce ngn
machine
disubtod
Listibted dawa denimed fo
8
i n t D n becaune
hauoles TOP/I P
rovsnmowt
speciliud
eciid du ttieclom dil aud deuius acten o othn pau
It.
Pontabi Jawa so l le
Code
Java enyile
tlan le
Joua ietual 3IT
uil dbrpaat byte
ve LNaci Cooas
hatuwe Mockune
Cede
Analuze ho clhanaclernstues w oject-siectid progamwug
00
Cencep
cemcepls m cluols
eyea ieated psuammng
enact
Encapulalion
dheritante
olpmorpmm
Asracten
i a ual
tame evtily wnch io
cm ojeot
eied- phyrieallyenistng
olyecdo A
collusion Logical uensbuct
clam- clas a
b y talma a
e n t a pu l a t u e n memoiy
he
cAooolafinduon
byc e a l u g a
clao u
allecatiod.
one
tho pherpestues
Inherctance -dcauiving
knewm as inheowtamce.
innetamce
Jb
amether a w
clas Poaneut
extunds aut
elaas ehia
e prepeslus o m pauit
Cild charadn do a c q i
Com hove b m ptuoyoesues
but also t
code Rwsalili.
tolymerhlism-Sk is the abilly do take mou than
ene e m
clam Shape
ea () Radaumale
anta() onas
owneaC Juamgle
3
dosthactum - t hidun e part and hewug
Ony eMetia voar Ue the u e
abstat clames abshail beywotd ús ubeel
las A t
exlnd A
clas B
3
: a a divd
elam uil
Multt- Ja drhwitamu
3
alas B oxends
aloves C exonds B
3.
Juanchical Snheivtamce: here ons tlam senwes as
aupen clas {bax cloans)o mete nom one Aur olas.
Base
A
Bhsuahiuttlatus.
acware i wu
LAl-
C
D
ullilund and iwas chucal
craale
JoNA pogam To
nhritpMcoD
class Anirncul i
void eat(
Suskm.o0t.printl n "Animal
n 2amg
3
publit olas nheutante
mulh-
doq. boak );
);
dog playfekeh
Sysem. ovt.println (); Lobrado r
Cat= new Ca C)
Cat
eat. e c t ) ;
cat. meow )
Dutpot
Animal ealu
Po baskimg
ainacel pairig etd
Arinal i taluy
Ca in hasusun
Suttae albut varuew denels psvded
povde
o préledn ubclane
methros wituin clamu,
Jo e Vaduates
ackages n awa
Cmd Jwhohe
acCesi Jened&,
hee Oh o u maun
n aNA V_ A parded.
Varueus lwvs o pheteTien
mthods unarked as priate
VoriabMes ond
4 Poiwate
an onccesille n g
withwim de somme clas.
clam,
Jtr by amy ether
vaccemed
h y cammet be clarses m pame package.
Ame pa Ckage
amd
as protecobd
w m e u o u i n g u o c l a i e s
mboels martel
Vaalakes amd
Petedod package And by sanme
w l i n the
ane atceible
t i diltel packagCs.
aga.
sueoloses,
n t o s pMblic
uctthedlo maked
Vaualls amd
3. Pblic clam, uganddus -o
cu accessible bfem any
0ackage n uhoitonte
th dehaut
ue acce modufe ib pe otia,
4 ault:
acces duwel is package phiwl
phlse
epayenls tu
deco
Cam
want te aneud Chealuy
am obed you
yeu the Meo
alstat wem tineugh
ceclane a claM as
statieinal
vaualle mhodo
Publlc
public albstrocd metods
1
Maultiple innaitana acliened biy wmn imlenace
Imtaryace doem pport caaliug an objec
T e n t u TO; >tko o potmb.
a das dnamg
do ud an bbyed,dhave teCnal
to accexo tu memes teylae
implurmat
inteya I1
int i-10; i han ocee
M a u c l s e t v o s u o u l l e s .
Vod nath )
Pobic Voj
d mathC)
3
clas wth om iwlertae
ompoe amd contiast
SNo CCam ntenyate
ela0 can hame dntesace cam hawe
sup perlz
methods both aubact as0nly abihad mthods.
am
enbend am l e l a c e .
Cevholed mmowmw
ows Cxteptien handluig mowagcd vta kyuod:
Cakom
3 uall
heur
wuous
code uol may
1 y : Jhe Jy Jock encleses ho t i s
potentialy h o w a m eacepuen a folloued Juy
block.
olochs amd/ linally
on e meu Cath block u% thiown.
On eccyp luem CCU dwitin By
ock cakthes amd hanalls ncepuens
3) tath : Catu
ossocitod Jous block
block
ha are dhroun witin Jdue
code o t is
37 nally Jeinalluy ock ontpins
whother an excejotuon
enecated sagasdluo
9Coualb
kuywerd u uxo T
hoow: JMetwow
4 am entep uem nthus
va
enpuely hoor
puoaam
encephenA.
o ploim ttie benehits and tbe phecer eaepier
homdlimg.
Jhe peoces ncep.ion handling iwvoves ollauiug
sups
Detedtuom: Jme pogtam detin am ed qephional con dilaan
nch aw s eh unepedtd iauaion , dusimg encept
dhandlu
anduing apphopial en Cepluom
dm
4 amd ene cules SAAoi- handluy
Cakchs t e cntpitien
addreo Oxaptienall condiaen
oeric o
Gpltonallya qmally block may oe
be
6. Cleanup
acuóns uch as ultaing
wxd To pem dliamup
whdines
SWowus 81 closmg Comnezuens, Jag andlio
a ecejoluey eccul