You are on page 1of 22
= OBJECT ORIENTED Thhesitonnce » old thm % eslled Types _o _ SInhewiderree * 1) Stngle snhuwitene 1) Mulblevef Dekesitore Wi) pariple rneritan te is) typ d Tnheritorce \) Hievarchial Tnhuitonce *) Svigle Trbwsiteores | &) When aM 8 Aungle bare , vw called Avrgle snbenifance - 4) Te las ont hase clan Example: single The terre fer Svar ‘pected Prottene as3, be2, Cy Public + wid odd ¢) § c= ath, cout 205 4 3 ji : Lam second ¢ public pare wwe 2) } UNIT OT a dari ved clan inhest| qa SIGN. LOG RAMMING, a)th ' )The muchanism y dusiviy a new chor frm an Inheiterte clo A] fase [claw B | Derived ard One derived clon . ) pablics =” obit veid Subl) Grab \ ack za 2 an \ ae he 0th 3 a) ver math ( ) second Ss; output Ss add()s 5 Se SubC) 7 | j )) Muth level Enbeuttannce : ") Mullilevd Theitanwe Wa Kund 4 imheitance in whith the Ausived clan ikAself derives Ike Sub clues the . %) Clow A saver an te eve Clam for Hu darived dam B whith in Han juve an tHe base cla pr the derived clam ¢- 8) the chain ABC ix called —_Snheitonte pale iS Pate i clan A clown B; public A] Clam c: public g fe ( ' i) = Clan tisk 4 Protected : tnt a=S,b=3,'c: Public : 7 vord add () C= oth) Cot Zee y y Clam Attend ; public Cvrk X Protected + int * (?) public i Void main) Void Subl) L t , third b; = aby Ladd 0) 5 Cot Lor, tee ’; 17 Sub); bv mull) ) 4b j Clam third ; publ'c second fer ant day 7 public: ¢ void mule) '0 d=oax, Cou < subs) ir ‘malty Rr dw) te a overriding | Mithed overviching *) Sather, Te ame function i difinad Mh bare chm and derived clan pod 4 7% Call Ha function usoad te objet 3B fe derived clan drived clan, phe ferein 4 the ts execulid: ghu wv Ennwr % purtkon over vicling- *) The faeces cn clorived clam over vit the funchor in base clam. ®) Thar at L motor por method ovat y Method — FF vaclade Ciostieam: hp cla bare L public: void pone oO cout Le base, 3 7 . Vi yoid main ( ) cle quuved * public bare ee dy t As part; public : 7 » vad pre . gutpat cout CaN! / derived base ti prank), eee 0) ) Method 2 clans base public ; vod proto) £ Cut << “bare sy claw clerived 1 public base public : vod print oO Coat Vittual votd pre 0) t i; clon aunived s publre bare cout <<" bore") abit : vard prt ©) i cout <<" dasived”; 5) J y void main Cc ) (6) f bare tas > pectin variable fpr bare clan, bane by — object Pr bane Clan derived ay.» object pe choi ved clay clan obyect & a = Ab; /_—> Aaolyd pratt Sait on print Oo; yu & pow do» pred sti a= bd) — Aol yng derived Clams pjeck a> pnt ery ee te bare pene unt ved , 4 pero oe pevived | Pure —Watuel Funchien | ae Nothing Funchon: @ The virhwal Sanction wth no no dlefinibon pat put vw called av pare yihtal }n- (09 do-no Huy fn. x) Pure intel guuelicn cloes not perform ery ask. declatd a erply ot witha ony lef. y) It oO 4) To cleclou pure Vithel function D> fre Preceded with ‘vivualleeguor. Sar be followed edn 1 sso S4ilax jor pure vishal fp: TS agual ved print y=0 indice Z¢0sheam-hy i: puve _yivhial jn: Clon Rare ubli'c + P \ . . Base *%) vithal Vord, print C)=0; Ambeek'd s ; a ) ) az hd; Cleww clevived : public Base L 4 public: void print C) putput 5 devived cout 2L"olerived . 3 yy *) Clases Hat are clevived for Pre base claw and provide te inp Lamerdtlave 4 the! pure, vittae! claw - called Concrete dun chiens ane Abstract bare chou f Tnbofer a) Abstract clan i clways a base clan, 2) Tw an incomplete clan , objec cannot be Created fpr abstract Clam . atures Abstract Clan: i) Th Ahoudel have atlecot one Pure virhet fn, i) thes i no_object pr abéhnd Cee. wi) Paintin Can be created fr ababeec!” clon iv) tt can Ihave elalarumbu A mombeafn- en addition “bo Pure Vrhwal fr. Example Jor abstract clin ZH includk Ciost veam +h? Claw Sample JA babrrct ublic : Virtual veil print (=0 j a 1 pose vy (a vip Clam Ext; public Sample Deon cee public g Void print 0) WU Breese Gia Le dae co a) y; - Ply Pos bax ect aie 2 aejor PCa pr pornts by eh object et S$ =4 2} clam EX2 + public Sample ' puvolic ¢ vad peat cq) Caan’ olsive class 5 % Ye void mein C) L Sample #5; ph bper Eur evs Err €2r4 > print); aah S$ >pratC) audi * Quclput derived clan | derived claw 2 6 Taline funcldn *%) the difference behveen an ovdancs) jrncbon and an inbire furchion is that when an anline funchon iy called, a) py An Lie perch, He Compilec cloes not have to jump te the Called function - Tho Aaver the funchen call overhead ang Vesulla in fasta execuben 4} the tone - ¥] fhe Compiler place & copy vi Trline’ Keyword is used before go name. 1) Defie ame inline function before aay calla, | At made ‘to LE FE inc me Void add (iat uty) int zy | Ze aE) | | Crt Kz, Void maw)’ | t ) Output | dint ®23b-2- ° add (3.5 an | =Wincude poshream+h > inline vint acta (int at, tnt y) . Zz) ~ aed) yehwn Zy 5 Votd main () he ml a,b ynay output ttn s> asrby a m= add (arb); Court <<; \ | 9 e friend teas a Apeerat faurctin w cat» whith tnapile y not bewg umber furction x a claw hw prsvileape be 20 a acbel dela Y acto. yatt y %) A esis foncheon oe aye rumiben fr | 44 clown 1 which ts oltolaud — ad a fred | or] He key and “ wend” rnnielt He clay- e es olen } i) the keyword “ead” oN plated only cy th qr daclouahion% Hel friend fr al ah we te fn dafinihien. Synkex ! Claw clanoname g fritnd veprahype farrame (oxpumranti) 5 Example | By £ntnd fuels, AFincduds giosheam+h> clan olumo L ne abc» public ; Void etelalal ) 5 frend void add (cline) ; | j ; vord clemo 27 fletedate) t EM >>a>sby 5 vord add (demo 4) t arte dara +tdeb; | cout Clam abes Claw ANZ t, ant public Q void guedate (int >) oer Friend void add (yz abe) 4, void marr) ? Clam abe abe 7 \ oy z my int b | ) , . a: etdata(3); ved jet date! (ixty) m2 Gerda (5) 4 by add(a, bi j fared vid add (rey2, abe), I,J y vad add (42 ty t abe >) £ int Cy Ca bya +t2-by 4 Cort priat ay i q cliwly Dragcam, ey *») An och ly Diagram yiaually prasenta - one 4 adhiw ov flow 4 tonbal ur & ty Gm Aimila to 4 flowchart ov dlaln flow diagrarn. 9 Actin alin gaara ane bn ted in busne Paoterr sodling Basic Components an Achwy Dieqaam D Aekien Vv) staat node (2 deacon net — VD) End node it) cones! Flow . Kviby) ciaqtam — Symbols ‘) @ —sslat Syord i) wo pcboaty Samba) > connelet Sejmbe Ww) Ls in Symbel hapnizabion bi wd > Ion syrnbel | syne zation het = a[s lib a Aviyle ocivd ”) y > Fork mb ane - vie Concurrent ac hiked “) S — > deciswon Symmbal vit) [cru —S lomditin bert yin) —> End Symbel ; Achwty Diagram [oxeles Paocwscting | (ow each Line hem on ovele ea) ahem [5m stoctey (ome vs Stock cvnigqnod to all fine Heme and Peyfreent cut howined (railed < Cancel O rcler 1a [nied te veosded) | & oD 7 digjeunt Atelés Stat chant _Spiagsom- diaqeam in & Ays len - aw peace b 4 component [0% ) gla chat desc vibes A cx component x) The state as o Auster. ¥) Glati chat diagiam discthen «hl rc hire « State machtne Can be clefrired ar « machine an abject tetiich — olefurce Lig ferent Atelts And ese dAtata a Coatiolled by ertenal or Internal events - Purpore osc Gla Chav Diagear Hhe oly nam c arperte 9% ays lin > To modo! te dite how 9S veachve ays len > Fo clesembe aiff erent gets Yan object duyvuy “dh life Frme. te moolyt Fhe > To model | > “Define a Atate machine Alat 4 an Sbject . ._ae Slate chart Diagram » > IWhal slate ? 3) a —> State-box x) <> —> duedrion boy \Vv ‘ @ cams Final Sele $ — —-S>Inial Preudo stale gee rd , Lordi'kion ol [laut itenn3 in stoc ie) Teen teceived NS [at itera ' un Shot t4 Auk Trem acuived : [sem ila nat un Shoe

You might also like