0% found this document useful (0 votes)
39 views61 pages

OOPs Unit - 1 and 2

object oriented notes

Uploaded by

Abhi Mishra
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
0% found this document useful (0 votes)
39 views61 pages

OOPs Unit - 1 and 2

object oriented notes

Uploaded by

Abhi Mishra
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
You are on page 1/ 61
% 7 ae ~ Gere Herenren ROSHRAMING. ee aie | Procodere orients: Fa a Object owented Progaming PS aloy Thandie uming--basit a _oitnted__pavgrom a ba fone wait fe ¢ let YL inshu on ter the Compides- +o follow und Ox ge Ira anese ins purction into_groups kno cyt _|deuneHon, — : + (bw nom use oo chorts to ea ltyese actos and represent tho follow appt DPecont alfonso: One ane oe Cader ttn 2 rnulti Jisnetion program _ Mann liropertont: olata_,/#em we _placed i. wean globe so Phot Panos be excess b er the etion. “d gn ee Each ferction rey have ttle own local le data: Globol__dada are more vel unable to jan .inadvinknt change by af unction nei pia gel ‘ \ tedere_pavgramming paradigm= th “Eophasis sa def things Calgortsnona]. iy i —— ee | 4 (Ode. pienso _ prance dota fro ro_one fra —— Gat en eS cleus oo {0 page — Ler 4 ase Ie PO Or + ae Po “Object Oriented. paopimening “pesaligo = esa “Object een “opproch. ik va econs eae CDE hie .ePinomineme net btere dois, He erm __appanch.— por: cheat data oso yyy \ yy yy Y te a a et pee +Hhot operate. 20. “orether ther Pmt ; _— (Px! grass — - ae a ce ltteale men Pepe Qe Known Cus — objects — ae pe etal ord : 3 Data —shucthie— ast : es —chaxackr hs tho objects: a > Re ection thot. mpecoke —on— ths. icin ae Bee Wen enbien mane aio oe in ths data _ | deat = a |B __etiiitnd ip, Saabs i = _— eal Fi pane JeSee |Ob; (pe shcatattg ii ae aire ii _\Dato_is holdin — ani gmt oobi be axe ess Sere yin a oddsd _urheneer Leann lad eet an This fo llors) the _bottenn = up ja prcysti olesign: is Basic cenupis of 0h lang wage ee 1) fobent le 2 ig): ae AL si at Seals SE Cua eR anon ie 5 i 5) | Nee ee ) Plat cacphicn A Lempat Fo ca ; = I} mow akfo peprtsett usex- -clapine. dactas such as Vectors, Hires cuodha tists. ee i — {Pan gro pBjec tu So pealal ab ieee ee ne that pnatth— Object —is fostonce. oe (ah pc ple ee Gites Object ore real tuexld— eotty, ne aypheat ii ares ae oe fe toke up ices eoecnnnyt tdi sWalbontins fc excade tro object interact by rae ss: ieizs. aie i eee te bankbelane. £och 6. Cree 7 Ande t pete rin con palel jack cata. Objects can interact utitbour\ te Krew datosle of each other ox codes - ae sedeT Latics Mi lhion® eee sak typeof -0f _creaponse iso blue -paat— or tem plade+— => lea ; = bs. |Site jain oheeol ocd 07 Hity ———— > IIeloss tha oe not occuple man Bay. ————_—— (2 ledass how ati bute ond. _ behavior a. loa cla ss_object has _sames ot bute.and_ pehaviourr: e a i ee. ae he - a ss > - —> |Object contain date and code +p manipulate . Lips ned olin ets ces oy Dune lay a ceil yas __ =>. tha entive: cet! of ee See Vee aN jobject can be mace a User ° a ipa a ject orve.. \ari =\cLorses A. as nu a_elass has beso dfida cue can cxeole that _¢ lass obec: be lerging +2 — fl plies ic collection of Obyeat eieailae —— — aa tare 2D Data Abstrachen lEncapsudationi=— es : er data anol_-funeHen- ; Loa _siag le seas ( called classy) /s» Known— as encapsulation» Pada ae _| fei Heats oF Hie class, the dato 1$ non= accessable +p. the butcice— cosrld. and me Tahoe a joie Ubhich awe econ in the Caer a0 Cole ghed tre &: ise Sea eonst ee cn ae P20 ps _hiel a _ und. sin pene hiding. epee se — Abs traction Hepes sto Teer =? nee obing essen: > uu thout — Paete o use te —concipt of ake Paciaed and eae ado lit abstract oti bute such 6 Size, _useight,— Cost and_ porto —epperade tm these Cétribuke ace ae _ofpributes axe some Hi oo So ees tice they feld_ir ee ee eee At he vitants —ic the proces. s—by usbich “Lobjects of ene Class— acceguined Has papa of objects gba Onn then * Clases As ds the carters. fohi erachjcod | eT sup po chosen Honk : noes “fer _escaymple = The bird" RObio” te thie wan gered of nVass. Flyin Din dtesemteb 1's ain 20. part bf tae class bid". | fp hort oF ebieibetar | fobs ercht Se (elle aa pormbo\teaire. “ust the, Clots \ fore. athich 1t gin cleminad +) > —— | Abie fs be ee te The concept os Jo lee oie ang. _papvids_+he——— ideo oF nee us abilit wxThic maaan A —thad-_ba— Lcan add addihaaal atures to an ettsH- | ntact tuithoed modicg ft thie ance Ble by. dexnied 0 neni close from ths encls Hg Cis PU Ra er EH al pry ae iro (Cone, Mm el. ey met phism 1s the. “bili totale moe ___ eed dln os one — icradas opertition- , exhibit _____ cifferen+ — were La _ditterat Instances Nera sane aa Abs papopcnmacnais tye of laste sect fo operoctions ~~ A a Fe eg Considex the op btration of adds Ps Nef ace eer thos pido the uit fn ots tele * » a dirtise siehpactiond ax_ching beac the ns — Lo ull Span ditt 0 dia beol— stab ge. puis SB eepactan Fiat (7 Rodho-d showea = Raclha Shan ce Stra + Sto RE SO id aden A ada cat Te paocess: of — m roa dpexatac i oli event brehawour iO diferent Instance ais known op dpervactor oncenloadliag — —— The Single iad nome Con be wsed vo handle “olifhZent number and diferent et = Nea rdeoct usii oa singl— ion Aone to p< Gi Msc ~dy pt ob acask is noun as quunetion oMe« Lewioléage——$§ 5 leew (eet es abraws.C-rectoinglt d= ie ate a — 2 | draw Csq So et J tok pang romain — is cu saibjais eren-ted. a Ftp Nte kus Hho polleustag sep: sgaglleat classes tha olef ine Objects ond — sae Lerman se Bobibitiur E Petes object frome Class a Ei distabich conamunicaton amongabjects sf “Objects Communicate cutth one another op Ledmalian -Ond _3receving —latmmaton auth the same cuay —_a_s on ae eee __ito_ ohe andthe The__concept of mm ase a. ee fires ___ basiey. Sage a system. That- xe setig—* _rnodle |b 4 ‘Similatly sp ae aan Octet a ee Case. “Sensitive programing — to “ae pogeamin ing langucy ere tection Migros iors! ee

ee Ht ine Itiola__< —conio- > ee oe Class student - i ter ae + ee Retin Bi te | cher Nome £2907; = — leat Sear pee Te Tae eel oe — Bie Aes eat “Rall no. ie = io celta aalaat al Public i= Plerobers declare unoler thea SpectGex public dre a e Class in levis lee_cad sabe the 3) instante. ml t = The ern bent detlawe: as oe —accessbls with jn the ig cla ‘ ; Rees i riaels double y= 21325 | a ples) Opa ie pee ato. a oo ‘ . errs 1 ey Bee era ad ieee ‘ Soars ime end} Dace ee << orl fismale Mame space ALocamespace ic ? -clecign tp avert apas— thi chifticu tly Cuad it trsed as additiocal afesmaaki ar Junchon a cuad_\tanicb mere cz 2 —— z 7 bs j tuto co iB function ar be if oot types is |podine io the clase ngoanies- team Al 2) Outside of the clase ccaticenttti:. i 2 | srasidle “The syntax of de aefine mero ee _||Riine ton ins tole—o oudcide the las.s_— One 0litferen.t but both type = _specifichan pr ees ear Horne biuld she pextissro the. ome — oR ee serie epee | Slew ee ine oO Meron bev PIOFS mee | Nine inte the Clasc— body opt te ‘chile of —___ to line member _punctian a ae - | 3 bhthen. a member forse ob ne oubricle the class tes falld outsole ern bey 4 chon bs tcl — “Compilice tread these tuto_ty pes — ee iiecteaatneycre eines aaa [oli Hexen manne pl cot else ON class ceuiderk i an 29 .etelbad 30) sc 2. jt dlisalony 0) [int a,b) i —}— q public i. | > eee + _getcloria. O |) Vorol. §.-eyo-t-}—<— == Lf or Dili nfl a Liptay catia <<." Eeder the cali" § to gata tip 220 ‘ | 4s ude jis re : Se “praca bert fuera som es sy nate of Saline— — — classname — en ete — ae : a : —— _ = docten. ee eed 1 ‘ Pavate! cree i — eet Ce. / : a b re ve [isle < inetwea.co bP ae Fh tusiaig snomespacds chat at wate, complex. a ek ak eh Re Beibibe body o ee. Nii olin putside._the body at ms: ith Poe hafaot (3: ) cenps- of nee colittiog || epxnactex. i ied rere aco Filed isa ppecoctor-is_used to_behind | Tenet feuncction —tuith a. ppondticsilont pee 2 _tlawh . | zal itside mecber far dbo i Decloxaton. of function +s lec 2% —1A4iole | pf ¥ difinttion | ich. thug Se ee a 2) Aoi Compleat! choc) ¢ 7 _ 909) t 4 en eee L Ascigomeot es Shenit Bo ee gua. Explain the. charac tkrctHc of. 00fs 2 getline 0. (DD grease tp_implumeo+— tha cane Lof class and. object 2 areca toipassthe she ee i 13, White preg one _doasand. ee Le eaplain._©a th.and exeny s Step ia ie beep Nak, ag re | quis. talaite with ercangole far dite xent tyme nd ot fp cece “speciGemt te ov — guegs Whhat_are the cLiftexere Petters ot acacia “gece et and. Surhat are tthe e Puizt) Exp lain tha — 3 1 pandigen? Os || Vamable cau F | regent bi Ha _polloroisg- Bt jai Ger in bo. “uae Tete Se ~ iCall by age Fee e e ca J ts mito oh sa Indie Pyps cly et an this method eestire cy of an object fs _poassel-to _the tinction “ ee heal by —reexenul Tn this meted adlewnu 0 an“ object is passed tothe function. —_=—>_||WinP Sain es taxa a9 an hi ——oubih _pbjecp . im a Nels method J re # include < ery am+h teiag Bar ema ae ee See eo it Wiese oe ee el —i Wold read ( ): my Noid acta aa en } Nott compo Beh Bion te _ Ee bees * entex easaluas Sa Cin >see 2 beniod 3 - “ +4 é “yet pacha, a on (am weal egal eceaibile ai po Tn__+his method "xe: —_ puncston- efi ian e cia ) siga: doe tro eo PO a ine fen 0 aoe” pprasied 10. forsee Sg pt uncon he Lirectiok.. SO Asie Ely _ ey eh jks ee jo. pla Leal idnealle citos net ected 10 Soo ctl ie ieee _soms—amo \form one _o.ccount +> anather accouot inopleménting — wear pan oe sila HEinclucl < lostream:h> si Nomespace: stds : 2 class account : a Public> 3 dere y F ee oe = = 7 Void show ) Piinie W oes a Is are, Jeno 2! <6 Genacs edly L _jeoutc<" balance vin 2! 2s bal, > amount, vilkh wl =) bal —areouct: LC woct-bal = ace. bul. + amouat 3 ~ A ‘ oid main |) _\ fraction overloading i—— eee Function. Ovex loaoling 1s eke of a thee. bject oxien ted ppwogre™ tam tcboY hose the oy px an aree. re an “seume_ name» ee clithexc Ot PAK L4en, | oo hen. cHon—A.a.me. ig. overloads d. ____llenith alized job itas called ferection pec. HONese fooling peu asia ila pages tele rn ein funtion name soleil tha schme and — ifhsent Cource o <<95 Court EDR leeching Malte 5 ei? os eta >> Be ie a peg sapsitin Ona ot Sal lone puncte wth SCM. name. ond_ ag * oliffacot num be. of. oe a | ea lat inc Iuele seat Using namespace std} Vora enageniat (eine NG janie He. aia | Bienes Gout <<" Vvolue ae hc ay 5 | pick “en. int ol besa # when Moba. j : su 9 pu He = ie Nhlip nt =" (eee ee P i aN) Page en i ole | eee ii lk al pune eed Cae jp sovlaet. wee ae ele i'd" ~bg cleclaring a _ prxototy pt_of bhi. exterriol pte wu thtn dns class: — u ie egi= Tuto conduct opectttian, ‘Lod er ae tuo OU fRyent C/As.s— panasees Hae nde a eon | _|Biend fiunedion i -0Uue of yect oxicntd — pry 1 oa ‘A cave Aint ae See _—.chorva ie eee eee __= fiend fun pawnibex of more er “at cloes it intial etait lien i teal to _0no__clacs. ie dee lone _becaee Mt ipa friend of mai ae ene ¢locs: —Syodas oe —_—- lWifaca + Class— a _| Bsend Function me 4 tHins Iuole< loc peomih>— ng _Nomecpatlr+ Steloy— clace’ second 4— lle dass First a Sook tal 2 ade te 7 posh... Sey Publics Noel wa antes) . = Coute <<.'' E+ Sie nay Cin > os % : i, ce scl (fine. Ie Class +ecand Tass in ( vie }? seconds) es Wa spa sia Ha CE arb sey) bik Co. Cout_<¢" Fast bs engai. mum bk le eee — ete ‘i ~—6verload | ___ d T gat ced (= WIE daeedatat the (ante Ps nn Mt incite < inceam he es u edi Aoume space std) eam Class ol/ctance _ f oe ce, Se hk dat Pipi. ig lt Display the ~racliue value "7 A ne ee Frans 2 j — a ——} hue ebt 2 20,40); 5 Objd OL pa oe ae oe y " | lo C189 tueneat_ of — wee foi be Cyeetpt A Ail 9 || pe lerence to —$ Cumat- class po, tha ce _ho _poss—Os— cr constant sefencnee 7 Ea Pea pee cba ze —useal inthe a ; tas dp initialize wa—object fe rn the ven) ess of already aalsting- object —u | nen pbject rudd fase in — scouts +— . ey ee Slate oe ge ania Sees hye aa Yatas i j= — ‘class Closs—name. ¢ | ini Rare ee iol 35 Creep +i comcast te inaizoma hs" it) f ae Xe! Ene Weliyelumaste wil | foe Cine feo) t< eal, nr ib iinkly 2 oe i ae oe eis ea cia 2 asia ge 1 3 _Meid_amsoug.} a5) Pvt 19 ldeas) fee Lint izoyos — 1 srokic a — Pudblict— : Vo tol tolota ¢ ) et Count Pras Dsih ; aan Link commt HOY Lat. td, — ps hoc ae: Fa at _mambex function ae p-caly. tan “ Stabe. enemmber -Fanectiatas * oleclase ia the same lags r Hoch'e men ber ction caanet Alte, | a stitec — mombor nena tah'e olata ave fun pais Pee) el pe a wnction becasue _|l¢-+teth'e _membey — peace look nt howe totaly 2 tana nm tl a En the name fit: class C instead — & nl gett ott ate | i lind Counter it count = leo, jae sews reid _main(d ABs je ft Corsten Ce, ae dee Coumntabject (dy : sind Aa Bice st 0t- CONE OL mel wa ear | —_— ic punt C4 i } ic, scounrebjece CY | a eounnster tigticounil ly, see | Gti Gay - ‘ a amar resp ecco || eperiodss rn pacadet cee Scope eso lechor——O a Be 2a) ) tit) || Conclitional | texnory ppexotet ( = , __ty) |(#) - = Poinsec to nee Bik a ___») || size of operator i: it —eV—_— . ~ Sean The Opexortec_pee Pai phen nieernesl react cuith s tandaxcl_ox— _bublt fa airs = — pic email | a fidacd : Binns a ni Host u ine fe, ; L ut tap tn seek t | opevadec thin, ‘orty ena + be pasted a < 0s trearn a kept diene pale Bote es acs Ourmnbe-r a Jes tee ET = apohtbed pilin a a prea > | | | | | | ae cei” Value of = NiPc ce cca by | | | | ce" Vole ofa ee “«< enol. aig EE eg bene | Public i au a Alum ber NOSE 0) a re le ame 2 ae 12s a+ 3 eoust <<" NI, valus ts = | Ay. chow t Yy _—— Cout <= WN vedo. rR ]p DS. a a Tt CO ae pO vaca ely ae Al salen te 0 eee hE a a Rh vaton= TZ —|- iy vadue ia 24 | = be a orate 59 bo) inctysdle < sitlib»h 2 — — —________ uli Glass eompli ae fae meat, tags Public 7 eo es iid pp clatieits ls) Raat ie iota i ae ae : Cout? ‘ cE SE ee ila 1s Cout <<" Enter the CaP 7a 2 g J Conplese Cink inti) é il meql =~: ne TL vi. Cout_<< "weal value & = Cee Aeon tn Cout << imag; oi ae re: it acl nil int) ell eee — ep {jC pa get data 13- ie ners es ] pee ae E fC dle

You might also like