0 ratings0% found this document useful (0 votes) 58 views33 pagesPPL Unit-4
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
Lic wa a .
Tasty acapmuawon Ws a mechani
Encopane’ Ra pin ido or Single Unit
Apat binds Code daca mounbet and
Clase Unhidh cankaink ane :
raethed| 46 wate to imple ° AOE DOT |
> encapsulation is & Woy ito Welch te
dueck aceett + dome canmponenk 4» ane lace
Benet :
bs hiding dota
2. More fluet bility
3° Easy to weute
Rocturas } } 7
b> We cannot Aorest any funchion fon
dre clase dive uy, ‘
2+ Encapailabion © improves, wa dabilty 5 Stub y
Ond malVkditrability -
S$. Ge WLC ty Cartel Like” * wath
1 Ficahd
dota mumbles. 2-7 ex, ‘aback dala pt Claas
Ab sraction He Th ths, process qnding tee
iervraland informabey, fiom Ke User anol
providing te pee irtemakion hid
nee sary 40 Ute . 7 Wil voweqpound olitante or wu
UUting IMmpkimintant
> Abttacton i Hi ad 4 meritahe fen Were
eprental Feakurees witroug iNebading, Har
boueqroind Atkails or eplanakim.
—> There one 2 Unde % abetactiony »
ha
; L able
4s proces f abit Acken + Proets s absteachon yr
uhin all Fueperans prvi a wroy tx 7
prograin to AON at Sere procure ie to be
— |fi, tutte pole Aing Mae .datowls hau v4
|
sp be dows. !
jopala’ abibackon: Pate Absuacian i Uthe)”
oe progeanines toeglo eutthe that Lhe
inh 96 navusol an a MAME, Arad Wa),
yee aemid | ‘ Trvctterb .
, it , sree vy.
Pe, Abe AHO | mode! |
1s ab staction Wong cClaugged > Abetaction Can
be inn phenquntec Ud clases. Claites pave
porate 1 pobre ydontifieds “Ey Wimil dice Scope
% tN vemmable O tunch’on
in heaaley FRE se header filer %
d+ Abs achion
Sonae pre « chobutdl
many Languages tore
functions »
eke. pow) , Sort () #EO
3. Aptectction using Acthie Apecifies
~ Public ina clats Can. be, actened”™ ery
Uthive th the poram,
> Pavol can be aciested only ‘utithin he clase ,
> paoletual » s '
Advankages 4 lata CUBA Chm :
aes Ve f
1. Progra organizatio , Moclifar tty
and — Atpawcds consplatin,
3, Plalppility hy hiding Abe data epresticl ating.Dara abshactini a dha” prods + heling yt
a y
rr Conaplexties fiorn dhe Uber. Feallouer iy
User “to inkérack with Ue! yor ak hide,
level unthou neceling bo undinkand. the
Unclirlying detail’.
—o Ths abel dhe fysiery timp ltr and easiey.
to “Lute and not Efficient -
ieee ae steppes * data ab seatton +
1 eneeprutati
+ Grrmastion hiding, — fs dhe hannaalt cs
A \Wteduile are hidden tom oly wodul, |
(fa 4
Zoe oe adn’ ete,
(a con) gem y
ca
Advextaqu + encapruladion: 1
t> Pata widing
D+ Gneeeased Flexibility ‘ 1g)
&- Crergcels' lily i
uy, Tettino, cool 1 Bcily .
encap sulads min Java!
ala
ee, class Name
az . ,
poralt wd CO
public We ae Aap
x : ' ys
vekUn cof 1
4
) public word stbage ( ink qt)Apt “ag:
GAY
caus encapsuiaty
“punsic ake vid yon ( Sig (Orgy)
Zone nds nau wom 17)
age ore poss? 452”
nd Yh oH 5
we selAgel ns
Sytem + ok ~ panin Co the
4
ole : the ag the peten ie Ig
encapariagion qi etd: ‘
cla Riclarqe
pivodt |
ind lergh;
int beadthy
publi’c £
Peckownepe C int (orgy, tik breadth)
Ahir > lengh = oq: :
hit > brtadlhe batedthh;
int quebengih ad
% edu 1urgth, ° c ‘
4
Ink GUeBreadth U
x
aetturn lpeardth;
me git AregU
4 meet (era # loreadih:
i)Abttrackyon in (4 7
EF tt incluclsc jodream. Ww wy me -
dhincuiole< math: hy 7
tat wmcinl) ’
< tat neous . 7
tnd power = 35 Wij
Td resud Powel, power);
Std col ce Cue 4 NEES TOU cet d
pees bo deesotea °
lp. Cube wil
Abstraction in 3ava ',
Novy WN IANS
abieacs -Cloul BIEL
db berate vod wun ¢ , .
4
cla! ear exdtnde BIC :
void vunl/
Z tenn ’
fs + oud - poudin'| ee Wnnnieg
Pubic Static vid wainl ing ong.)
a
sadly “ys
Birr b= mw Cr;
Be wns
y
5
ples wuming aoeScah abeticet fy pis bor poromteniiad 7
) Wak access Covsols re proricled 7
) eu aCe Comols One. specified ?
) the firm the ConkQiinere for te
inlerfan to the type,
) Uthethia AA Specificeson the Rype te
flyfleakly mepororti fam jk IIMpemeurtat7 ,
pur Wu, Abiko kypes:
Ese Leri3ed cues tyot data Ay pot | WY Cet Ody
uP) Ce md ‘apts dllou, we lesign® opt
nparcanautort %
an Aot hot can Skore ny ~Lipe %
pan an. alo Bhoutn ae opniic clases ,.
4
5 preckefineal for Array, wot , Sao, Gueec
and dickionary .
Ae Claman’ 9 pancumtserisect
» acetscoct cthroulcfy irdleking
> tH, Ala, jova and Ct provide
suppore for pavaanatltri sed
“>. ML dale —_sbypes oe .
bull th cde—taypesr——av_, ‘PLocul_, Koo! 1 byte’
char, Double.
NMP deep e —
4
Ataiodthes ‘Can be -"
Ap.
Houck, salt ably,
thn.
“efertner— hepa ——cteurs— type, Orreey . .
SGWierfan. |
71 Implenaund porannltes'zed ADT incct,
spe can tse Memplats © Cir Luge ,
denplati < typename PR ,
Class gectae < :
Public. * 7
void punt tluvard);
T Ppl),
boo k sc enaply ty
Pratt 5
yee at vector <7 > elanwteds +
RePRET as 8
es
ae
_ a
1) cops fecuener in aralt BIE:
_—— ie
Spratt date 1S 9 pure
prpammirg larqucee sun US Orairally
crtacd in th ATS
> There are 0 parity
Shucsurtes 30 mrall4aik -
cejZb - orensd’
ard Cortnl’
—> cop Satur including jeck , chaler,
Inherttarcs, arcapculabion and pol iprarephiate,
te CBC. erarything if an ofek ohiree Ce an
tare 6
ut pink | eral
varalsss for Akorirg
d+ clas. A
a cette
a, das.
“erage
brding dato and Cod ine a finale ud -
4, Grheriton ° multiple
ard Pe e a
rhs re heforid — baicrchica «
“
g rib
4
vata6) polymonpenry: MUIBPLE WVU ‘dt Quo g :
clase awe mulliple impluventapon wth
qu sOmt: ROME ‘ io
w> smattalic alto intwrducwd — olhes fecthune-¢
Grtludi ng : Bs Mtechecer ng
1) The virtua machin . Do
2) Woda — widen — corttatter( myc)
4) Diougping by Gn s pecking
y) Clones
) puck. pingpbyick_vibsded_proqatncraing An Cxt
oby cls in poqrammivg . oop aims ty Trylervand
etal World enbttids tee anbemi tance, iding,
pours ec. in progmanming -
fasie _—Sencapl: _ colicin % obyrgs. ;
be cut: UL pone VEPTES EWING a oproup
obyeets With shares ferue Conon proeatsu
are Lanavios -
2. objects AN object vs CIN twstaras 4 claws
S- encapcebabimn .
Ys Abtkrcechten *
5) abthachion Wing Cloures
iD clbthacem in wader Mee
= polyycypnise ° many rns »
auitty of tae mesons dp be ditplayed
more thor one rm «6-4 supports opt ator
orentea ding and furchon exer tnectie,
1) operator ororloacding >» Hh ff the poet
odor 40 exhilrt different havior
an diferent WtOrC ES
W AUN oprloading 9 HE Les & ingle
Inchon nan & pewfonn Aiffer end Apes 4
kaLsles -
& Gnheritana : clonive - propertids £ charactentityy
Gorn one ctl ts anothun cla!
» stb _ctous - the claut khaz inhonts
wm — cnother clasies i$ Called
cub- clas OF cloried clase»
jhe cheese cLLnOle Propeartis
® yper alas
yo
owe cisived cub- cleus 4 called
ove clus oF supe Olas ,
meget
ae ig the
an ope, ‘ ming WN
Cet snk PT Pham
it je og
Oop is akout creasing objects thay Gp
iH
both data cond wuthods.
CH TS ample ancl Pow Kl oop larg
tvetiped Microsoft Mu ON» New Fray
ctl is a Cale sunetiee PIAEInrg Langiag &,
SA clay ts du Sundation a ba "ty
dee Ch - on enked Lanquaat tn ct.
> Gh oop languagu, ik iS required f
+ TR ores data. A claus
creatt a class
lode
is a blu pint an pce Hak Containy
variably fr stain data ahd furton
performing wusthods on the lata ,
7a 17 ewslheds
cw
check o rend
Method y.
—> Ain object fSon trukaner A tee clas. &
creaked Forno clay. ARE ONT iae
window suse
ts
> web appitdin
A ditte butin
{ > Whb Mvice
> eB.
> Th
four find amnntal Pr reiply q
Oop ore Cs Filles:
) Cndapsubdon: GL iS the proce 4 cam bint
“a dea member ard wethad inty esi unt *
Class
__
ca aN |Ophea ye
ve 75 Kee PIECES clariving Prepenties oy
g
lass ko chitd Clase be
\ wee Gren karer i ial
fut" i}
, hierarchital "
muth level
> ethyl Gnherttace Nas .pna bue, Clase € oe
duired class:
> Nevarchical- multiple ¢ faseer are dunived
fm ia Sra pase claus.
> Multiple Ghheritance 16 nee -AUpporkd in CH -
8 Abstrac HOV:
al is dhe processing @ shouw'ng only he
"tory Gnfrrncdion anal hiding the otha
“hovant Information.” :
Y poupranrpien ! ei tm
> deta astne rarultipte forms, GE allots
% clas, by have multiple implomutationoop A" 1S Geis Ee waqvin 4 Ada 8
2 fund amitod Pineiples : - ~
9) encaptularson 9 Ada Sica vop,
including amMiC bet
2) potty rer phian i)
cod pterns
beqin
Ada Text - GO- Puk -Lime C’etallo world "7
end Great }
os with os Used te refrac enter mal areclorly
ivelucle ing]
wut are ek iN proidine (#8
Ada. Text _ qaaticage uuprch = Contam 4
ne KEE ON tho
for urby 0
Bocidure to pei scren ,
> Great fe a procedure
the pograin «
pu une fr disp loping dhe mag Tue
Wee pine (0 C-
thd gree vs wd % ete RE
> Ma vs Unique amang oh?
Cok tien and etimivare or
Lanquager + WX
thugoep in’ Tava»,
i
)clasyG ects
2) ncaptilesm
Q Gnher tants
YD polypmcrphirm
5) aphacho,
oestoth
19 Ltbpreqrany let ConCumrency :
Subprogram { cet | NCurENCY 1S A PFOPAUMInng
eelnaree {nak {wolves breawing doth 4
pagqran inks aval bpmagrams ar faks
Blpas | | GON] xclx ConCepmenety
>There are 2 Levels 4 Concurrency ;
1. Gntbuction eres 20 more machine
: Gndbruiatans — Smultancouty ,
Q. Stothewont lwal teu os moe hig ler
Skactewunle — Simulltarneo wlyZe tinit fevels 40 OF more Subprogram oo
Siri ano USL.
Appicahors +
Ie mcittiple Conap Use vn
2 reIple — PrOULs04 wa, Conapistr~
wou ildiple A pplicedien § umning na Computer,
a vafortes,
Ginplesnintasion 4 Lubprogamn Nevel ConCurrenay,
treads — AbiPads are WapS Utd — PrCCLs
Atos Un ail the cme Protuds. !
9 . tases dnd futures — sore program ming
Languages pron abachons titer bate Atmel
fies dy rrr, SUPrograrn ua
Cort stub tly.
2+ Corp stints , Corasdints are Qensrali'.ahin
43 YWyroudin2s . Cernusines was multiple
eydey 70! ide -
E cI Stes 4 1)? ‘oom (Corgda gee)
tng st oc use
= Deploy oniprt -
UNIT - Be |
abprepet nr tere—cancermerieer 9
Auge Ores! SCmeephe et one Uae eae
yowiables Kad Ovre Used to dole cribical
gewion — psoblom by wing tio cctormic epeecuias ,
Wat cin Aigner cre curd “Br procty
Synchro Wi 2Q6 07. ‘
le WUE + Ge cha crenmawss Wu vere + Sf
sys nagative or smo, thn nd
ho (S +ve, ef
operation iS peoformect.
wuaitcg vars
o Ye
uthile ( Lae o) ;
get
2
Fe siqnek operackion sn cre rents
ae Aiquat y
the vel orrquinud
Syed; siqnall)
oH)
4
WUPLS semaphony : 2 LYPLS.
. aed 1
1, Caunting Abnoaphoes - Thue cre integer
valier semaphores ard have Cn Unrestricea
velus .
2. Baneny AUaphores — TE Errevy Sumayhoses ave
Ne Counting sumagrits bute their value. be
Whicle tp 0 and (, work operation cuore Whsh
Sivaphowe 15 Zand Sarat utoree urhon i 1 0.a ‘ \ Nikos, Cure
a) wlabion ship 4 wwonitos to Ada, Soci taasicone den
he wonityr if a package thar Gains
dartd dala steuckunes, vperctions cthd
dynchrontZacon LE Leuy procectre calls « Therese,
monitor if alle cholun ak dyrchrenigabien 4a
Tara, CH ,Ada ave Sora 4 the languages
that allot the We & yuronitors .
Syntar 4,
Monitor Duwo = |fuome % Aba monitor”
Monitos > 2 pe ¢ F
VOmalles 4 Syrctaron) LccH0" «
Cand bon VOIBANES *, 4 Corupatition Synchosnisate
Proadune PX aati ‘
Pocdure (>< ----4 Gn tamento paning' me eoy pasting is we wo
fr obec, processes € eo uncer to Conominicads
with each othtr . Chit wed tn. obyece -oitaseal
prareuniig * sndter - nn Communi Cadyon £
porate’ cope
[ Thesc ©
Ia
cass [_corcrunen| '
occ GettulTE
> Metlage pasting can be ae 'gpomnentss, Vike
Or Uynchrowowt +* f
— can cued wm diteibud “glen » 40 Che charay
the taser.| He Cycke q ‘thrtad | a0" »
—— on yt | bloc bed soe
to Mec Merk 3. Waubg ing, Mek,
J. Active date y. tinued wating
|
5. terminated stool,
—> — .
Koc ced] Nowet :
SQ rn
SL & ACK Unig getting
tek (eee
COUN UN
i< a
AChE steaty
Fined y
pleat Ue fe
fr cpu-
re
pu bie clan Mutrerd Echends thread
‘ute void acy ty
< : “uel | yy
Giplen ow - pinta (Hello in Loread ;
pubic claus Main X'
Public Static void main ( Shire J aqs)
m ;*ayttrerne Abyseandk = YLUA Wea tS,
Yhread « Kear (7
Gem - a (oa)
wml “Luelle fom wielin. Lvead")-;
j
ct threads :
Cunstarled
Sie
—
| Block
“ree Hints i"
ia ean Leads — these Ae Mia tery
threads 4G oh a picatin
2 ikcqreund ‘preods - A€cendany thezads.
Suinchaoni 31 dtreeads: 3 ways
Le Tha Gnkertrcked clous
2. Th tek stetterante
2. The woanitor claus.5 ecelpion, © ee cepey
—— on 1 CU LULU Or
yeceeped erent 9 Uunich OC CLbs cum ng
execrio. 4 .% porary, ue, at vun ths |
prasons By ercorpb'on.. , \
1 Grad user Anpat
qs Dewile 4cnlure ,
4g. Loce WE cui E Connechon
Us Coclt error : '
Types cept :
v ~~ b
User el built in ewerpbm,
eee
checked — unchecteeal
cla! we fourd conypst
except j : \ulllpoiate
rlorupkal cee fore
ekcepbo!) peace,
a exception do tect
filand fund .
excerpt”
sat é voip
exception in Java: |
+ ception
cheaic eal. , tucksetoedt nisException ” propagation: ris anes
ee to if the proces! we
pson propagation
dending exeeprions ‘frm, + cand =
du calling nvethod >
in ad [8 wl) ni
calle |
a
> extph’on Propagation in Jara. scar
iho at ecerption Urwin fav ep oy the
tock « Len HE not caught » the tkeuption
dbvop! douth the call Stacie 9+ the precedinA
watthod Ge mt Cowait there tk
farther rope dotun 1 He prions mtdSth 0g).
y exception Kandi in. Tara.
exception “handuirq in Java is au qe
qu pound fil wuchanimn to handle the
wntiye er Ath «as GbExceptron,
CloLss Rok Foeind Exeaphim , Cunt exciton ec.
e bly» Bk DOEKCUPHON
Typer % _Pkcap bens SOU Pcp an
Iecheabedt ekctptia) —> The clase that clivectly
aurchucleid ekcephin Maho tie ThaoeLeab le cleus
_excapt Poundina deep o'm £ -
| The clausset tae Bat ibaa Gg
Cun et
_ on MO OKCUP ons ts Chounn ag
turchuc ico eecoptions,
& esror +
Grecrercbl
* OU Wmony enrcy 2k + Adithnuatic eee ptton
Chins eam - Lullpoinder’ Exceptions,
Towa exeaption Ceyuuends:
8 Ceyuirds: Hoo
t. by - by’? Eeyuod fs ued &
Pei ty a ble.
26 Couch —. ‘catch’ pbloce ts Wed @
vandle the exception,8. finally. rally lplocle = 8A
eurcule lhe wwoLsanyy Cocks 9 _ Program,
Ge Amor — throu at ecapim
5. Uo — — claclare Ah ekttpkjon
EM t public shake vord meu €tring onqp 1).
‘by .
, Me 100 | 9 5
aa i trowahicexciphen e)
aeeliae . pintin Ce F
i
syptun
5
ME SPHIEI TEE the cos)
nO steoli") ;
ah
4 eeerption handling, Caprbitves yc:
3 3 eager!
ty - Specifes a ad: Colt ta bo teed
Arrow - throulh on ekcepéion ,
catch — handles the ekceptin
ty
fae 1x '
a HT bteck 5 Cocke
Aproull ekaptin
Veatch (74
HW hWondle the cold].ren Rag
en!
Ms
f
wl witli ()
4 by I
4d
Uno als
|
catch C inf
| \
Coul <7 "Coed Ve te +
i) ‘
Catch Cece,
Cow << * perc tecepkaly 2h
vehim oF
th ta)| eT GE Ptr
‘ Gnbrduction aro Kea boas
}
- Ah
=< ing —ts-e—
Bare Re
proryrcu mening 1 ceehie re
> loge — programming $6 A POTTAM my p
ii ,
Powadiqn tras uses “bral lege to :
rra.ulealye and reason Abo tet
Te piwt
problems.
> Prolog Fe the thet fom 9 PROT Mw
log'e
év + Dalalog — prolog , proloq+s | Cock ,
Jancis, pooP , At? C AN Ue SMe progam ning
Appicabons +
te Farting anal FINANCIAL Aervicrs
2+ Commetnicaton a. (abcess ploy
ws amnones EE arate (2 ls a
5S hocclth core De be yi
f+ Infomrction Sonic, ($+ Dotkalscuie nyponatl
4 Grclependent copteuane vercorg . '
BL Ateneo es
Gm (wed shoresNOENALY |
loge programming . longung
declarative program ming ne
de fe wed fer artifeial inelligencr anol
j Compudabional linguicbics . @ is band on
clowns ; Fist - order - logge
1. Fags +
‘an Prolog, £A0H are stortannarts Choad
ore -ayumed ty bo hu, Fac Consirls
4 pridicatey “And Onqunent . “pred tales
Tprewnt — relationsdhipe q popertits andi OTOL |
lps tho peck
Orrqyurnans — Prom"
Syntar :
pedicats Concpimusd 4» orquwh 2. - Je
parent (Dnjou , mays) -
2) puns: ‘
Ruts in prolog defines _vettionchipe baw
SV Ohur gads .
> eulis concide % Mad = spacihes resub O-
. Conclusson,
and body ~ specifies Conditiont.
sya
head i Cenclbon 4 ,concittn 2...
ere) :
prin cl4O.01&, 4) ParendtCx NM),
4° Guenes Gr proleg Guenits ore sed
etree Anformnadin ey tok aelohendhip ,
Sywar ; !
:
e ~ yal .
ee ‘
0 forerd Canjay, rena)
4 vom! . ;
Tables; variables ore Wed in proleg &
eps ent = unbhRouun value,
Thay stan
Wurth cin LupperCoue Leben gy an undeeccep é a“boy = poner, anya
s. loagcad_eprrddos :
prolog provi das logical cperdatons to
Cows Wh Conditions and qpalu-
aw matin. beyical opea ako ane ath
, conjunction (A) copeenss tabical
gee
vi) pigurctm Cv) : " a! Oa
aD Neggeuion ( ny) *. vs uw oT. cnt
AND OF
ex" . 0 Oo 0 0 ”
an Oy | {j
4 0 Oo 4 4
Lod i Il 0
eth