0% found this document useful (0 votes)
31 views9 pages

Oops

Gives high level explanation about Oops concept

Uploaded by

Divya Bharathi
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)
31 views9 pages

Oops

Gives high level explanation about Oops concept

Uploaded by

Divya Bharathi
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/ 9

1 0OPS what) 6ysttm

8Cject -Oniented p09Mommin9


is ung
0OPS
to dsigm
phognams
usurg lasss
Mthedalegy

uman
BAin du
COPS.
2Main unYnlu 1 Panbt Nal
ata
*Abstracti on:
Kata hiding Funions Fere
th uullavance data/ 3
tidolung
ue yant de tal
ERpo&ung only thi

Ca unNe u thu neak pidal


stung te... with sut knousing thi unlnol fund
unltnal, fund

kncapsulaten/Systum Cwappim9 h data


d Function toad
to qu

Birodling thi data aned toguh iin


puHaue togulhe

eniity. Aimply ky mas pH0letung *u data

achieve
CPu blic, Private, pmotecd ed)
chiev iomation hidng Accuss ontol mod ifivs

mplumuntaon hidingthough uatenintuj are


lass
O ClaK. ( Prut Intare
wtnich Lar mot bt
vaniabl/ mithcd
o u t Side thi clas
alcs ed mival ho7 secur
m et h p d
it as

simplt Kupmg
HLasens

*nhvitante : Husung tht tode


puovi dus ailib
vehicte
CStuduntcollee
Can oto
2) ultiliuul HitnanCal
1Smq trhaitonu
Ba6e Ras

Oived
oiv)
ubrud
Vintuaial). 6) Muttpl,ne Hoth
A Bas Ense
Antiph Base (hinMullite
Clhildne - ivud
P (Base) ptuden
t6

(Colegf

Pa
pa Aotl Dynamic
Sh:de larly/Stat
Compultume Klun tumu
Comunk ope Vviuat

a2 n y . 9 : Juck
etymo2phuwm Poy Bind

moxphM {orms.
alaliby e an bjet to qet manY Oms
E I am ginl /a qinl

mothur, w, 50ftoane epginev.


playg daughlu,
olaughtu in lau, sistor in laus, si

Fun owrloa lin g epl abv owrloadung

OuA ridin ooidng


94ight AE
L n0ang
Public Show
C i n f a ) eang.
cuna
* ublue phow COuE 4t sh6
opyatoH ldaoing.
Function oVnloadng
nt mai1n()
intmaunl) 1D,b:12
+ 12 22.
woiod show( ) Print Ca th);
void show t int a) Stl a St2 = b;
void shw Cinta, intb); PMint Cairt +S412);7ab

void 5howC)
PoumoH Ph!m

void show ( int o, Jot Lempi tume u n hme

Fun OV1
vintual hmc

void show linta, int h)


opuH dtoM 0UHDading n a OpLHaton
Biay opLHator.
inctude <iosmeam. h>.
Las Time
pHiVatt:
int min
nt houw6

Publie
Tume (int b, int mn)
hous h,
mun m

tHt
voiol opUTaton 4+t) addfimt)opatoT 4t (int).
2
mun t t
6 min >:60)

hous +t;
min bo;
-
=

void display )

Lout L2howns 4":


" Tnin 42""
3
3
int maun C)

Tum tl 6,
30)
t.
addTne t); ++E1
t1. display t14 opUiatom +4
OPutaon4+ (6) jnt
hatu/duromit bindung
tind
ude 2ibS neam . h> # uncdude 4 ipsbuom- h>
omespate Std urg namupotu
clas shape t )
Uas Slope)
2 publuC Rubluc
doubh hu, liphs;
doubl bose, he1qht;
b
doublt a, cdou bk
doubl hape (dou bl a, doube b6) oub hopel
base : a; hast :a,

height: b ight ummy


doubl, area t

dsublu aM ea l)
e eilual
cout 12'"B se aLa

out 24" Bau aea ";

Tiangle: publice Shope


las
dass Tiarnal: publue shape l d o u b l a, dou blk
THang Shape Ca1b){3

doubu La t)
THiarauldouble a, dOublu b): Shope Ba
"

Coib) cout 2e Tiamg


ub OH ea t) nutuuin b ax Aeipht/2
Cout 2" Tuiangl Base ";
ubun aase *height/2; Uas ngle publie Kape
a L b b):
RLe tung Ldoublk a,
lavs Reckangu: puhlue Shape Skape( , b){3

Rectanqu (doubka, dou He b) dhl axeat)


'

Shope Ca,h) 1 C9ut 2 " Reekangi


Bau"
duot aea t) utun Base hulght
Ceuut 22" Rectangle Base
Lturn Base * heigh
int maun)

Tuang jo.o, 20.0)


und main t)
20.0)
Set
Tongl t(10.0, Cout 44
S t a e a)
20.0)
KLceangl r (10 0,
eut 2 t.anea t)
Kuckang FC10.0, 20.0
puurntme
timne
L
Lenpi u wm

V i m u a l

ge Valui eo.
u d

miansyaSameola t hV a l u
Mithod /Puncten
Funchenl uthod euvloadung
Same ame wwth udna
Same tuncuon mame Wbh taramelos
Same
ANL /ste faMomels
angumets
Achievnd ony thnough inhej
class Bas
Bast
clas
Publue pubue
int a, b, C
void add(2nt a, intb) Vod Chwt)

CoutLath: 4atb; Cout 4 Bas las"


Veid add Cinta, Intb, int 3
Coutc a tbte) Class olMived:pubuc m
publie
3 void how t)
int man t)
LCut ' Q n i cdass
ve

Ba b
b. add (o,207,
ind map)
b add (10, 2°,30
Base b
Cauurg BA 6ame tuncti on dunived o
with upvrenk objeck,
b. haw t)
oHe
uent opwiatuèns havung
unt uses Eg:>>*Righb d. 8heuw t :
Shift 3
lass Iphone
las it tht bluupunt, Phone
las
vivo
bisct s hu prpbdus Oppooojet
thi blupunt SamSun9.
abu tuts
You on uati many ( loo k )
functuons wrlhin thl c l a hunctiens (neceuin a
vond hest hunduens Can muic
,
be Calud usung t u r t
ts yuct a t thi dfeunt
ip
L e n s uCtoH
class
tha h i
un ctuen hounq nam O
USLd o initiali2e all the duta membun5
ame

It oRs n hau ony ubun t y


cena buuckoA

1 ht
comput utomatitally HwT
utomatucaluy 0k
thi um
It callud
CHLatten

TyPES
7apault consbutton (no pananetns)
oPy eNAtLeOn CwiH

POamui sed Ce u CtoMCuwi th parome bus)


be lalud

th clas an
consIu cton Lalid within
ThL
eutSidu th clas hy Opuiator

A: publuct) a const af
Clas A
sed when db)
Copy onstu ctor:.
int otht obj.JE taki
C a s iniali2e the clas 5ame
ebj th
publuc L Nu to an e

AC) ndec as
LonstnuctoH
Patameti2ed consiu cho:CoPY
Lonstuckon.
had clas p y on
las ube
las ube int a, b;
Pnt Side;
int 6ide Public
Publie
Public
Cubec) Cube Cint x)
COPy(onCint x,ink y)

Siole 1
a*
Sidex b

J void olist)
int mainl) int main ()
ube cfio), Cout 22a 44": "2tb;
ube C Cout 44 C. Side In ma int)

out 24C Side COpycon obj (3o, 4


wWay Cal Copy ton Obj2 :objS;
ealunq by o bj)
:7uiHh
e(3.m) Ob disC;
Implcit tall
i'nu(3 5)2 0b] . diSc)
2

Coll CCallngby panam/cint


Epli it
(memoMy
alloathd to thu Obj by using dy tons).
d y hmuc r i bi ol Then pa1amcteri2ed callud o nia tata
memb

kCinde c Cun X
oak tin c (a);
destrD
Osbu cton ud

*As mame implus


ConstnuL cO7
ky the
*CHealud
la rame but
as
thi

talld at the
S a m e

Hos a ame which iss tallud


with
tibd Cr .
Hecedded

F ubet)

Abstnact Clas:
the
umplimentatuén dutalu u,
dtalu wh
* PuO CUs hiding
Abeiachen .

in
khouving th untuen alite
Absbiack los.
dLdarnd as
+tlass
d method mpumantl,
NeLds to
to be Catnda
dou nst
ouait Bljlcts
Con' be nstan hatis
en
ViatualHuncti
a
das condains a pue
to zuyHo
puu vwelual unctien Hurrten Mame nuualyed
Vinbual veidun()=o;
Cuas an eiyot
absttacd clos
pentun d uyerc
vanib alMg with
Tt have pure tual unct ien, monmal tunct,
dnie dasS we ik inugad
ULd f07 upasturg so that
das Ban K
AbetneCk l a s s

aaMvitual void junt)=o


lassHarg
l a k Ia c c o u n t a n t
C l a su u st a m

void funlc)
-- Vid fun2t)
vgia tun 30
VAtcal v eid unc aLUMId
ky all
duuwtd 1 funch

basud m thm
funtugn
ati Bindirg
410S1 eam.h> Eary Bidirg
H intdude
5 td Bind
uung
namespace
tum Bind Run ume
Cempill
Ban K
class Muthod, Funtuen
at un tmi
publuc PHp culecthd

Vintual V8ud fun ()*o; thkud duru


CeTnpil! lerne

Bank
loss Manogen: public
olwlpmunt

publuc
veid tunt)

Co 2 Nanaqun;

las wtemon public Bank Lpy enstruuton-

publuo Viuana wntion:


void un) in Baue
o n d a n ed
Membt fun
out 22 ustmn AS
as udytrud ky du

in mam() duni vLd Uass


at u time.

uas an uj lk by intia liang


Manage m
ukemes C; t wih thu anothur epjut
Some cla
mfunc) eak ohjiuk is thu CoPt 9 the
C6unC enisting obj
5tucline.
vanuas voueus
Onkuloee gueuping hu Samen

what a das mut doa yp uunud y


Spras
do inufauo Class fur
dilaned in rulattd ubn1
MDds
Cthlschion e
bucau
ae abstiad by dyae in a sig
way to achi eve tokal abstaLen
Su ctuwvu class
Cous net upp inhnitana ponts inhu tance

0apurg Vauals Cetlucton


wihu
utoud Yas
a
Vanueus data up uluund unc ura
same name
no a c s Apefibn o
ho acous spcifu on dec
take it as pni va
tok! ik as rublue
emosy llecatua m
Mumouy allocaud in srck

Valuu by

Ud fon BArelln ameunt


usd to7 large anmeunt
doda data

Paxa miluned cos fauthos altype Cers i disute,

Ctuuto, btatué, enum, xeqiktt1

You might also like