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

JAVA Assignment - 1

Uploaded by

Avyuktha Raju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

JAVA Assignment - 1

Uploaded by

Avyuktha Raju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

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

Anhwiih he c/ct7 Atyl y t e and


Iamyple oM
ealuus m Ct4

to be ounce
ject euietzd aNa o mol'dengnad
Cpo Compalbble t h any oMi Aamguagi.

medel' uin eova is inple amd lasy To


h e olyeat
edond
phumlive datalype dikL itegt toot a u kept ,
dhe
peowmamte
as mom-object Aoachuve good
gtuctytped
Robust automaeqalonge collucuon
0
object eueled xcption handliny
cetluoon uued
aulemaluo gabage
9 kuppiu
eielad tneplum handng
eeduppolo obeet
ond
psogtams bhat
dt alloun to ude
4 Mul- Ahanadad
de many ngs aimllaneousy
ophitoaliol
Jhe awa uwme y lum pevdlu
a

4twuan irpaoce synconisaion


w once suwm
once, u m
u iit
neulbral: H syqpov
5 hhitecine
tumu feieve
Omyuhwre m y
lengevy Omd peitabuly
6 7aWa suuppotu clhangu.
h a u d w a r e changes.
dengel adus handuware
nd
and
OS upgtads
wnespewve o a pJognam
pepimante
Jnpselod amd g upsesetatiin
i-e.
H an
lehmedialo

tis
cempleolinio
n me comp ,

ode Jurng u t umto natwm


ona yv-to aiheoy
ians4eimed
code Cam be
bye
mahime Lode h favnulial
ava t al
dsnterpaulid by
The bt cod qality enui
eulb.

do prioduce ngn
machine
disubtod
Listibted dawa denimed fo
8
i n t D n becaune
hauoles TOP/I P
rovsnmowt

a ukusce n o Umsti madhinu


alleus aocming
Jhis
ainiulayto Lecal diuk URL-Uifoun Kuoue locaL
alleus fragmundo o wil board to be
9 momio n n d uele acCe lo obje do all
updlala Te vei
9uunme
O. secuwuyH haNa sun dime s y u allous acces Jo oyee

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

disoupliwm objed. (data +nsuad)


wucu gives matheols nule
dwe a
auud m a h e o s
data
Encaphulatuen -
Wrapping Jup ot
oncap8ulauon
s known as
y e unal we Cau achiuve
dehnduon

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

mbuitawes amd iioe


S plaim dyhunt fype
Gowa pegam to eale
aoNa muliölevel Omd maiarhud
Mhitamce
Jypes inhui ten Sub
ingle whruamu: heke supclas inhilo ue
Healis upes clam

las A t

exlnd A
clas B

3
: a a divd
elam uil
Multt- Ja drhwitamu

e oose clam fon othes elonos.


acts as
desiwed clao aloo
elouo A

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

Doivd Deived Dive

4 Muttple unitamce": hen ouu das taun dhone. ou zan


oll
upa dass amd dlheit teatuiUs rem
Oa clases.

A
Bhsuahiuttlatus.
acware i wu

5. yid mhesidana tua aleve nheutauu

LAl-
C
D
ullilund and iwas chucal
craale
JoNA pogam To
nhritpMcoD

class Anirncul i
void eat(
Suskm.o0t.printl n "Animal
n 2amg

elass Dog. extands Arimal t


void boeukOi
Suslem.out.priwtin C Dog is baoking );
3
3
class Labrados exlends Dog 1
void play feth ) {
Syslem. out pntin ("Pog babing );
3
elass Cal exends imal
Votd meow C)
is muouwi
Sysum 0ut.printn("Cat

3
publit olas nheutante

pvblte stahic Votd main (ing nys){ Anima


Labraden );
Labra do dog new

mulh-

otoq eat (, togCot

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

tim in owa vnplain.


olouw te create packages oud ue
clodes
closed Ond
uand
atkage is a conloune fot atorimg
an ubed her Jparlitioring h
uieshau ackags
managole modulus
de more

olan nams pate ceUihwns pockage


mame Apace
he clom
JeAneid
O Jused meduls
io dinidnd iulo Hnn
on applucaluen
En dlewb pheo mmos, hor
each medune
i by
deelotped 0
aveid
To clajse.
same omm moy be amgntd
clases, ackagc
Jhe mamupa.ce olmiony beue
fpphicatan
odula 2 module 3
nodula

pRage packag ackag


Pack 1 Pack pack 3

dam A elas A dam

SneulA vovitam he teloiy


ana Souhce kilo
4kila pockage statemurt
d n y Mumb inpost tatemonta Copstonal)
decdaraluem
3Only one pusic clam
pate

synlan : packag e package-narne ilename.va


Je Cenypile ua patkage owac

phlse
epayenls tu
deco

Vai bila lea clan memau


n dhe spanne package
u r clomes
Nem-s u daoes Jke Same patkage

ubclames n Ailhet patkages dvbclaka.


ae nethn in Une Aame PpaCllage ns
Clanoes tiat

6 What us anljate nolain haw e mplereil thL


wteryace in

inlerJace n ama us a suhoaet Jmpe that dahuu


n posibly Constomo
alahadt umutheols Omd
setset ef
o uwoy J achiove alhacuen,
Jnkosaces pevidle
Jvewen clome dmnd
ollouruig doowe couplng
a clos
peceywhat
enabling pvmetphim. hy
t ne hew dees i
muwrt de
as Aimilas lo a clas
Jhe dasintuon el Interlale
i ntesae hamey
in tesate
mtam
VoiabLs
tAtuddo

Cam
want te aneud Chealuy
am obed you
yeu the Meo
alstat wem tineugh
ceclane a claM as

CUe met absiacd


altact and
Jntesyace
metheolo sone by dejauutl
3oulic Ataio Oud mal:
nteace variallw von by default,
intesjaceinteoca-name.

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 )

abslract chovo A impamauiy TI


Clas A Implemmo

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

Wel as conciiti ANA enuards, t


metheols - Can have delault
stoctie mathod
ad well as

Multrple inhetante .Interyhaca duppoto


Muullple
3mhesulanu multpla mheritance
o mot suppoeo
nly balio am
3, auppe led unal, noninab, maloalourlu
ae

Vaualdes Tlné and nen-slalic


pemitEl.
Variales ppetaol
drderhate eomt
4 dmplemenlaluen cla Can wolenmet aM

implemoil am aaiate wteslau, ca

enbend am l e l a c e .

A elae s declarud Intelace


5 wehd
uwwg davn kepuohd.dedared umng
dnlefaa keypwend.
c l a s Cam Andwut Smtenface cam iwhus||
6.gmheitamta clam uriug axleuds omly awm metace
ywd nd implumuut
&ninteslae
la can han ate Camu 6nly
Acces
oy 2fe omemer hane pwie
Aike publio,psiurole MomberA

&Cemsudoe A wlas Com aaMe Jmiwlate Comusl


Cemudo muthods Jne a tarunudo
&nplan how wa ds platfosm ndependent.
7Owa s plattoun -independlet poimarily decause e
byleeoole samd dhe 4wa Vbua Machine JVM) Nos
a oria nplanalien
1 uecede: whwn 4awa kowce cede is cemypikd,
0
is ranlalid ino plalihorm - undupendan loytucode
msiduens
wwwtead smachine cede hiceda usa set
et the 4ova Jiial
Machun (JVM) mathn ihnam ora
apeili handuwohe plotiom.
a. Aana Nwlual vMachine CJVM): he JVM is a
matuine thal
eltuoae ump Jemenlotuen s a NÄual
enecuts fona dytecede obinacb auway e
cmd spesal y@m olutail,
umovilyjug handunue

pwgtama acdoss dittaut plathe'ma.


osa
vamu awa peaguoms ahe Cemoledl
3. Portalsility
slo btitods oy cam m ustem wdha
Comypalibe JVM inataud, sugardles e udeying
harduae opehoiwng sytm Jwis allews vana
applicatuano be develeped once amd n ' anywheu,

makuig owa platfem mdapeudent


wwt vepwn handlng eACile e kiyuoids
enceptuen hamdling.
Js amechamim u
MLeptiom handling
Ckeis,
dhat dralo walh sunime
poqkamvig Jongunges
alue Rmewn od vlepiuonk m ysem aluc And

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

Jhe hows Rourwed s used n


5) thhos
woncota thata
metugel gnat
Whew n meie t
metned moy

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

. Jhneumg phngLom gevehalw m exlepluon


ejot o suphescvit the teepllenal condlem

Jlu edceptwm bjet pauopagaled p


3 ouepagauen
wiil dt iy cauaht by om
Jhe CalU tack
pop.iali exceptuem mandla.

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

Beneis excertonal hondig an


6Rebrustness
d o Jocalisatu
3 Delugy
4a8ale epelauons
5. acap daoradat

You might also like