PCCCS303 Notes
PCCCS303 Notes
What c e tHe
Le diffnent
diffeoRt typs, af Iheaitonce
teattance in JAVA?
Desc >ibe each of Hen lt, dioqary and implement
Bseugh pogranS.
One
oiented eroganing- Te's
oft e ha97e fectunes of ojert
Programming
poceune hat allows s to Seuse code by
oetenencing
well as
he behavioun ad data of
Le
object
Ceneatfo Liieroney of closses,
he
mertonien class qs
loss.
qlve types of Dahaitance:,
1. Sigle
Iuhanitnce:
class laheis
Siglem inhaitonce is when
Supoclass.
Example; class Animal
vod eotC)
(Class A
class (Class C
aoss D)
Cluss B,C die fz m
common base clossA
Hybid Taheitonce: ylot Iahaotance ls
Combision of tuO types of inheitane,
Tt's cchieved b
Cobini-g he obove ypes of
Iuheatance jn VariovS ways
2 what is function Oueleoding and fncte Oveniding?.
Baiefly axploin och
poegon.
5 funcion
ovaloading and
Function ovei diig
Concapts in Oojact-Oented
Found n lagvoqes Gke C+4 pOqgnning
and JAA.
tical
Function Oueorloading -
Functin ovloadi Occuns wter
uliple Functios
elass Same but
differeit be o type of hel parntos
The
conpilan detamines whte fun tin to call
lasad He ogunents porouldad duing He futio
calli This alows ue to Cneate
funtions wi sllo
Functionalthy hot occept dirferet ky pes of
input.
Exampe? puillc closs Test
public statte vold
malnCStztng
Systam. out poitl Cotr ongs)
3 Test. main "Evsnyonc"); funetion called).
Rublic tatte uo;d moin
(strina an
Sgsten.out.
t on):
Tost,matn (Hallow
Cueryone",Gocd tagi
anl,
Sgstan. out. i¬tl (Hay
thae, 9
Oudput nain funcio called
iSPoanatoiged Conslnucto
Constuclan accepls
A paametonis
allou 4O
Values. Initialise ciect atnibutes witt peci ic
Example! Closs yloss
daf-\nt- Cealf. value:
myvale value
g-oject
nyClassCH 2) # Gnattg
object wilh value
Cop
Constucton- A copt Conslucto s use to
oQject that is a of
oject. coR
Example: class yeloss C
Pablic
int doto
hy class nt vaudi la
data en. at) Uau3
Static Concsrueto C#): Tu C# , static
used to
15tolize steic manben constueto
closs
bekane any iheikere
Exanple: closs Hyclass
statc yClass