You are on page 1of 8

Asignment -11PageNo Dato

Oieet yicned Concepby 00)


Depinepolymorphin and dius wh ranpe
Som The ability an operutor ad funetun bo tase
lipk fom i Kkewh poleynaiphiurm.

EHindude<ietreenm.hz
dan addiion
Pblic id Auninta.ink b)

Cout< atb"<«ath

eid AnCint a iat b int c)


Coub << athteKatbt+e

Vend Mam)

addibion_add
adde.dun (0 20)
adds Aumluo,20,30)

Jhe ahove p0J1am_ have dass wh lam nane adeutin


whh add kup 02 thrue mmbek actoragto thi panmeber

O.How to brdye tuo danes uing fued furatn give


aruph
So Anend. Pundion u fuutiorm that can aen
Page No.
Date

the picak mmbvz_ o_that dan, ue dnlhe_d pudin es


faiernd undidn usinq bhe kuyuerd FrierdA"Ruend
fiinNeg Ke kyapi ach abrdye hbwe
UD dasHCS
Exape
dam A
dm B

pivale Int b;
pulolic Blint n)

fiend i prmbhdua (A &ax, Bk bY)

dan A

pnvat h int a
Pubuc A lintn)

a n

fnend veid pnntvalte(A kax, B&b);


Yid priutaluelAk ax 3 &bY)
"
(Buk<e"Ihe valu We a ="< 'ax.a'« "and b =i
by.b
3
PageNo.
Date

n thi dbon _eaamp yeu ean that he friund


humh on_an be Md to a n ths priat memkts q
N
|"both the dases as 4 it belong to the cleasms. Hena
iit acd _ 22bndge betucen thut dases

.Wht_u_aomrutor ? Can we DYCload_COnstrudor


Juaipy he draknnk_wth pnaram_Caanpe
StmA_Construdor u_a dpecal methal of_alan that
ini bialje a nuily enated cect bhl type
COmtrulon Lan he vdpaded
Ezi lam Aea
E
publie_aLal?_

Coute cdn k objees mad

Aealine ngth, intE bradh)


Cout ata aj_Xeskangi'es lngth* brcadlh

Vod mam()_

a
a la)_
a. aNea5,6)

h ah0ve ptyran_h e clas wh naunt aLa_und a


|COrubnukor_ auattd wfh dmuhame. e dau name
Page No.
Date

and amthwt otruutpr u deakd lay RHng


bradlh arqunentA
4 Dehne excoption. dia an atleant one tacopltán type_uka
Cxumaple
Soh An _excpion Uapeblem that aUs duung he
ecution oapogrann. Whtn Cacpron owu the
hormal low cf the PmqTam_u diunpltd

Jawa epthpmaL luv typ


LBulll i acephbn Anihmki CaepHun
2. -dehinad eaepion
baap pr_ailthnlti_eaaphn
Al vithraekéExcephian-demo
puelic Atakic ve manl Stnng[Iaxgu)

int_ az 30 b=0
in C =a/6
Syutem.orueprinthn 2UMlla= "4O
3
CakhArthrnuh.Exeptton e)
Sytiem. aut prnthal" Oor "2:|
3
Page No.

Date

Jhe ahove iaample hwe dan AittrnetiEEepn-demo


COl a :30 we Caunot dindh any runkea
th ze hL_thus Come_Unden _exaphowma! Cans
5 Dane_paukage, what au_the Akp imoled in ouamz
dlhnud Rkay. with dnnple.
So ana pakage orgmisA 4aa l A Into nmupaa,
pIDMang a uu_naeApa rtauh ype iE Lontaint.

Stp:buaking_a pakage in jara dan ht fomae u v


Amphand eany Td_unt a paukge hy follauing ii nernue
Paukage Xampel
Sttp2:Lduces dau in jaa paukag, bu uersen
that dam Only han On paukage_didwraton
sp3Now dyind paukage u_AManfuly Cualed
w cunimport iihto olhon_prukages u i h funti

Fxumpl paskage_Czanaple
public dan ghy-

puhic yeid ahewl

Sutn.out.pnnbhd Hello Hotw aw yu ");


pubi Ataki vee main(Stningll ang)

ohj, dhowL)
Page No.
Date

6.Ezplaun bietly the Omponw and ontauners usd n


Aungl
on COmpontubs ng
SWinq nponenl aru_ douvd fiom TLomprank l : hu
Only eapian a the foun topwl couéainen : TFtan
Jhpluk Tainlow cyd Malag
Jmponcnts inhtribs_ AwT clams atasnen md
COmponint
Al Awig_onponena are zeprsrrted by claes in te
HaONa.suwhg packug AL omporlnt dsss dkant wjt
TJlabel, TButtonTodhar.
COntam Uu
Theu a tuv typM of wnkzuneu
LToplel contaun
2ighe wught wnkamen
LTop_lwel contane Tt do not inhevit Jlomponenti
Eachtop wel complnent dyus_a wkukrin_uf panes
The top lwel pare u TRoDLPamL
2.uqntwvesght_vtbamei It inheni Tloaporun
LUyed tó organuze graupí of Wnpni. Cokai Can
COntan_Othl ontainer
DitMe_btkueen mithod Overoadingemd methad
ovlirudungmethad Ovordoading method oveiding
OuIA_lith inAame da T uA bituken bo dasw
1.y uy cdam subdan
( Page No.
Date

Inbutane u no thwelved ineuiamin inolvecl

One method dou not i d child methad hides that


amothn Cpatent dam method,

Panamutens muwt he dikeeet NDK_pananttu mus he A1am

Rokwun ype muy b may nDE Le nikuwun byR mwt be damu.


am

T am _example ompilk
Hme polymoPhum bime polymorphin

Stahie birdig u_bung ued dlynamc binding d wd

8. Eplaun n0 o interhauing uhde ingzlurunking nultipk


Inhuutana h Tua
p a dan inoplurestzmulkipla_inkeyaces_a An ikeik-
|- inEUTHae ahtnds mulkiple inkryueshe knowh a
mwkiple iheutane.
inkertaa inteyaee ntoy aal interfaa||
iaplemini eatends

cl inkohau
Example i nkefue_hntable
2
VHd _pniut)

inkeryaeAhewable
2 od pnnt
C

(o

You might also like