0 ratings 0% found this document useful (0 votes) 33 views 6 pages OOPs Assignment
The document discusses concepts related to method overloading and overriding in Java, including examples of class definitions and method implementations. It explains the role of the Java Virtual Machine (JVM) in executing compiled Java bytecode, emphasizing its platform independence. Additionally, it covers access modifiers and the principles of abstraction in object-oriented programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save OOPs Assignment For Later Assigactent = ok
4- pehae Hetned overloads EkPlan HK an exanPte.
ee eee eer ae ore!
rene j bot aiflevent — declaration of — PalZ ater
Use otk different definition he the tetaeds:
exe Sad te be overloaded and tte focecs
is catted Method omwteny
Tava suPPot — PolzecPhis tHeweyph rtetted = ove~—
ely Sone Sntecee, , ruifhle —“etreds”.
ExanPle» -
Stass Pexwen L
ste nente
veil nocepe of
narte = “abe”’s
; aa = 20,
void accePt Coen. inte Sf
nane =
, Ge 7?
veid dicPla {
Srste™ out: Rintle C “Manet 4 name )s
4 G50 ot PReinttn Cye 7" gre);
Pome statee Void main
Cate CT ages) £Reson P= new Pecson ed)
P. accePe e335
P. disPlay 35
Pewwon “Pt = nes Reson 635
Pl. aceePe Cyrs", SS
Pre aePigy os y*
2
4
outer t=
Nate > abe
Ape = 20
Lane = xyz
oc = Bere
2 webne — meticd sverciding © Explain HK an Cxanfe.
ng mMetked — ovecsi % a featece In obvect -
edented — ReepZnigg chore a Subclass Provides
SL
a sPeeiPre pe PikLientetion of a rtetiod +Htat
te ahead, deBned Ww We Parent class. Me
ovecid Metsod In the child class should
have the Sane Here name, vetuen ee,
end PawanclexS as +he t]ethed i feo, Poon
cuss.
Eka Pte. -
ctacs bace §
Inte
base Cit ad
Huis. aza3
i
Void dtsPlgr cs §syotess oud. Partin C “Race a2 adi
4
+
etass derved ettends base {
BE
devived Cint ¥, Wty) £
sufew Cxd>
his. ars
4 7 c
void AePlax cS §
sefer” disPlar 095
Syste + ob Pantla CO mexived >= "47)5
2 oO oF
Pole static Veid mak Conty oye cry ge
devived Sts neo deed Ciee, 2053
St. dis!
i
3
out =
Base azteo
SDedved J
Se what ace commiand tne arpurients and how ave
sey used 7
S
AS comand Bee apres ace nhs Rovided +e
a fgpa et tee Varta of Me execution vie the
co Mand - Wre wierkee C cht>- 7 alles ses
to Pass deeter oe conftpuwe by A be haviove
a
CHtovt ~ tre ices,WO used 4e Custedze bey execution &
Providing extemal inhe S
CO Age mets ace Picatl entered after the
fps mane TIT oo sePawted oY
Sfaces .
Fn test Pg, Ons %
nn CO, OO 1 eertrtand - Vine
copes Passe! as an 7
on i Soc, 8S: s a Oo on
4. hat fs he Java vietual prtackine Cauay?
Siges -
oO Java is called the Plater Rar indePerdert
ea tt Poy langvase -
CSF OF
Ae “The Jeva vietual rtackine Cuv+) is a
sconce env ixvonrtent Te Java +tat excevtes
Weve bptecede - Tt 7S an intepval Pact of Fee
daver 7 Rowtine — ExvieonntientY CIRE) . The It
acts as an JwterReter betecen +he confPiled
vava = Reopaa ChHecede Nand Hue under
hendbavn? Tc or
Java is catted Plater fort - inde Pendent because
Tava types ee et conPit'led iwto racking
code eee: nstead , oF are coniPiled inte
an ntecnc4iate feet catte peed - Te
bytecode can be 9 Ckaewted on any tackine thet”
has q get installed, ~« ted of te
unde yoine bade oe ORs ersten:Ss siPermentete — hetoscen
eth Sutter
Ag En caPsvlation
Uy mt ts he
method fe
infoctection .
eve. ¥ ~esowed
wo Plerentation tevet.
W) The Reve of ence futetion
theo
done.
WW) atrsa
Moa steps!
Protest: nertata Fon
ee outside
W Ft can be iePlertented
esi
access
Rivate , Reotected , Pobie.
WO zt hides data fon
divect access
Cdacte F>
Dd coe encafevletion, issues
or of “ae decter
At
be exert Ple-
Recess ox
contal ys
eet he
Sheovid be
ent
ie anean
eoxtd -
modifiers, te
oS vsext
aheteaction and — ercaPbuletion
Absitxe ction
zis a Poeess cc ettiod
of obtaiaaee tntocration .
Abstiction sowe Pontens
et the desten oe
inter frce levet.
ke Peeve of ahoterretion
is “what? +o do-
Abstraction te a car of
hidiryy vanecesse:
Konfocrtation «
Abshuat classes and
interfaces can be used +o
inPleent abstractions.
Abstactions attecs accese
to cfecthe Preces of data.eceess sfeethiexS tth exarPie .
defne 44e Seek
shecihes in Bree
aaa Metheds ,
Op Ze
6+ Desexibe
AR Access
ec ernie Po nenbet
Ctasecs > ebjent - etented
deternine whether otter Onn
et Paxticviac nunther ex nel.
The,
Ca
sfeehew ave:
SSaHon access
OD Rave :- Merhers declacd as Rbwe ace
Becessintie Pret gap Pact of the Bypeunt «
- Popwe int nurtber = ley
UW Rwate 2 - Accessibte ont cite athe Sane class.
Prt nortbe tes
- Psiverte
eoHAin the Sate a
Acaessibte
GW) Reetet
and sobetacses
v & > Peatected int nutbew = te}
GW) aehou Cheetione -Pivete) >= Accessible ont ottuin
he Sete Pachigne Cro Co Je
nutber = ley
int
Eps