Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
30 views
20 pages
OOPS Notes ? - Removed
This is the required notes of most students on oops in btech.
Uploaded by
Teerth Bhardwaj
AI-enhanced title
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
Download now
Download
Save OOPS Notes ?_removed For Later
Download
Save
Save OOPS Notes ?_removed For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
30 views
20 pages
OOPS Notes ? - Removed
This is the required notes of most students on oops in btech.
Uploaded by
Teerth Bhardwaj
AI-enhanced title
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
Download now
Download
Save OOPS Notes ?_removed For Later
Carousel Previous
Carousel Next
Download
Save
Save OOPS Notes ?_removed For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 20
Search
Fullscreen
yooPs) Ans C4 i bStamesbmata aim: of) 00? = laste? bind.» kogether th 120 dnd= athe functiong that» operate on ae = mo other part of he code Can access this dato mlignexcept this -Rinetion » s c Class + Tk 18; a user defined) data type» Which» ho\dg Sts own data members and member functiong: con be accessed and used by creating an Anstance of -nat claga. | Object : When a class is defined no memory is allocated but when % i8 “nstontiated Ci-e,object is created) | memo iB allocated, t Encapsulation : In oP , Encapsulation iS defined as bind! togetner the data and the functions that “mans pulates Mt ¢ Abstraction: Abstraction meana display ing information and hiding —he detail. sAbswaction using claskeg -Avstaaction usith, Header files Cmatn-y = powd) Only essenrial ag Polymorphism + —h Simple: Words We candace poly mee. tthe ability of a meSsage +p be display ed mere than one form. 7 + Function —ovevtoadi + Operator overtoadi " G tne tum C10) 26 , 39) ‘mt gum Co, 20)or, Thheritance + “the Ga pabiitny oF a-elass +o. “der SUSE properti eB and charocterlaticz iS catteg Inheritance, « SubClass +) Superctass ta79 io Reusabtiity, a oe q Dyra mite Binding > =H dynamic binding , ne code to be execure: Rn wesponse 40 fihction® ean te > decided nartbo myrun ct ean rom another claas Conptructons : A conStructor i8 a member function of a class Which inittalizes objects ofivah, class% Hq Crt Conssuctor i automatically catied When the objeck createa - TR has *6ame name a8 Class Rrseft .oig¢Hiuhs .& Consrsuctor don't have as setum +ype- ae, Defaule Constsuctoy CNo poramexer Passed) Re Parometrized Consvsuctos 3. Copy Gonsteuctd¥ Inter? /nsidoNen Sse q . Desteuctos in Crt * Derived claay desteuctor Will joe Unvoked Firat, then -the bose clasz destsicto¥ will be “invoked, és Acceaa Modifier! fublic —)can be accessed’ ccbynany class Private !~. Can be accessed bry iby 11a fanetiod ig= a om Provected = TX ia also Anaccessibie outside the Clase Einaccestble oourside -theiClasa) 5 Class but. can be saccessed . ley Qub clogs ot thar class » io eis 1 adeany ess — Medi fiey defau\t the a will be pxive Notes rf We do wot specify Qnaide the class ther! by modifier fox —-the member Grenticie ch wuAmetmend class” can aceees and protected members of other closs in wh fr is declared as friend. a Ex friend class 8; 2 mhe vitrance, Class Subclass 2 acessmodé ~baseclas = t a. Single mheritance v 2. Multiple Fnhevtrance [gat none es 4+ Weerarchical nhertrance s. Hybrid LA Combination 2 F IBIAS Or more, tViPeiey iz aay 3 : i j Polymorphism 2 Operator Overloading => Compile time Poly 23 Function Serena > Run ttme Poy Lb Funetion “overtdin Oceusg When a- Class has Q_ definition of one or more member2 of base cagAsvantagex of Data Abstraction 2 a a « Avoid) code duplication “and Fne. Beusavility. é » CAN Change nresnal @mplementation of cies andepeniendiy . Reianviad snail q Srucuye Vs closs + Most Important difference %S Secussity. a A ersuctube %a mor Secure and cannot Shite eB Membes function and Variable While class WB Secuse and can hide %# poe eae detcfilz. 3 QV 0 local Claszez “in C++ + A class declared “inside @ Punction becomes local to that Runetion ond 8 exiled \eca\ loss All. the mernodg of local class must be détined * Rnside the ctass only Virtual Funetion and Runtime Poly morphism + A Virtual function ig a _membérr Puncion “which 16 declared Within a base ‘claag and redefined (@everriden) by derived clage { Functions are dectared with Viwtua\ Keyword 17 brov bage Clase Exceptton Hon alin caviar { q ey 2 represer a block of code -that dan Wheew Qn exception » ion apn Carey + repvecant a block of cose mihat Ger executed When error \B) throw, (oi-o) smi Sow! Use to “HYOW On exception:} Caters) Tiere (2 QQ Specta\)-carth block 7? = § At catchez all types et error: + Taline Function = Inline iB a fequest mot command , Yd i TF 12 function shar {3 expanded An \fneé When tt ig called. When +ne “inline fnction ts called , whole Code get “nserted or Substitvted at the pote ort function’ call, ‘ane vewan-type fund) ER tb Sey + * Function Overloading fe a feature Yn *wo or more finttions can hove same At feren+ porameterz . areal a } Void prink (tat 2) L Gout
Petnt ¢ 142) . sapaeeaecias 5 33S ae = tS Cae aguw © Svupportg Procedural er blw Cand HHS @ nf ansd rate Sioa ig Krown as hybrid Crt i vel Nanqvage , because st So ! bot Proceaura\ and object iz oriented — preg Yamming . 8 ABC ‘does not support tne [© c+ nas RUpbort Corll poly aor ooks Concept so % basi no “phism, Encapsulation and _ Support for polymorphism , Anhefitance as % ig Qn [ encapsuleton and Sn herttancer|> onfs tanquageny sitet = ZB CiB a subset of CHY eh Copley Stperser of Cc 3A @ contains 32 keywords + Or+ Contain’) S2 keywords Covbric, paivate, Rrovected | o apy) “Barely > ANVOw a) “5, € ig a finction driven Ciao «Grr tevan Se i yh v | aaa The “must be defined outside tne class. a | > Static “voriobe deesn'+ belong to any object , bur | ane whole Class , N ug i one: - DP TMhere will ben only n copy of Static member variable | for ne Whole claaa . > Exe class Account ft private : int balance; Stave fre Tot ; fi Publics pe Noid SetBalance Cont b) ee i babne =b; 9 b Wintalised ovtside doss Float — Accoun+ +2 Yo4 = 35F ; Void mainpbject{ Pea mab “Reser eetared cama a a eS Stove | Account "jae 7 spay Serena THSITHS HOD + Staric — tunerion in 7 x a Qtass Fence sH= oo aie Static > members €ynanong 1s) are eral wed isto occe ony ne Static data ~~ membera or member funciona , eConstructorz qo (a'yalgrvad) Hunts = Constructore ig an Special_member. yofun chlominjiak the Class. Tr is avtomoteay Fnveked wnen an by eck | Ig ~ created: > > Hr hes n°. return type: K Be 3 Constructor has Same vame_ as; Class Stseth + 5 Xf we do not spedfy , then G++ aompiler generate | Q@ default Comp@tructor for us. 4 Sabie as Consweror fo. Noi y oct Defourt Porometerized oa Claselnamet) © pn@lass_name (paramererg)') 9 aiess_nal la Update) 90 TY mvpdare Cte x, aun © of | fupes ( 4 YP San =bd=10, Wooti| seq ou Altea i rapst269 T zombo sare sie ny VotQuyt 21 fy= 2 Compiler qeneratez — two onstrucror by nESeN = 1 4: Defadir Constructor fe Fee 2 Co Constructor mm Te 1 ig crated by vs Bor tt any of the cons +vuctor mor ee create b shen “default constructor Will __ Compiler - Construction overloading can be done jest Mey funerion overloading , Se ¥ rrenola Dejav+ Compiter’s) Copy Constructor Can done only Shallow haw om -—a member -Qunerlon Which -destructs) or deleter an object . => DesWuctos don'+ : a Seok Rar argument andy don't if rave any veturn type S Oniy one destructor ag 2 Desxructor cannot ba poss ibie Sorc. Ey Bebo desivvetor doesn't destroy oblect 19h ia tne last fonction hat | “nNacenmmeerare object destrey.| 5 | ‘cam ee “Objecr — Resoure Destructor ts used, So hat before deletion of dj we can free space ailoarted for thia Yesoure. Ble ib ob\ 9e3 deleted then Space Allocated for ob) Wil be free but resource coean't, : Operator Overloading Cae hove Vthe ability to Provide special meaning 45 ane operotor. } “4 Class Complex 5 t oe erp SORE mcm (Complex Lei) 4 Complex» ves 4 RZD= curd, TER = C2b;As '' con't add ompex TOR ‘ditectt » Set = Can detine Q. functon. with Teme e meeda write operator Keyword ngrene So, > weG" use @ gu cperator Ave this . ‘ ee as Friend Class A friend clags can awess he Private and > pros members. of omer class tm which Tt ie declared Friend. y ° cere Gan be friend class and friend function» Ex: Clase = Box i 4 private 5 doable widin 5 poblic + ‘ i > friend void PrimtWidth CBox box), Noid Serwidin( deoble wa) oto som Nold> Box»? ¢ Serwid+h (Box double Wid) | 4 width= Wia', y ee Nola printwicin (Box box) Se 4 Govt maind | ma 4 Bor box 5 5 Fe frox SerW i att ( 4); - Print Wictin Con) 5 |Toher {ance k A praesa of nherting of ete class _— Base_ class e 4 oe fy 7 > Nisibitt Mode A - bose loss B= Sub Gass Prvate blic1B Sub Clog: = E Ce 3 and) INISibI ity Mode oloss A+ [poet 8 q sb then _Peb\ic member. wih be pubes tm Bn and. proea will Protected , OFA %e publi A visibility mode is Private then: both protected and gowiicN memser of A wit be Private member gs Bs a Relationship — is always Ymplemented aR (a | povtic &n hert+Gnce . = Constructor and Destructor % —rheritonce Firat child class Constructor wit tun during creation of cbject Of Child (close, bok As Soon ‘ds ob} ig erated chi ld class. onstructor YUN and %H WI aly Gnatwers of FER x axe and After +ne execute of ponent dass constvuctps = StI], BEGVME FH ConBt nor ection , od potent conptiucens Call k Ba): AC) A Constructor exer q a eel While @n cate bu desexuctos, ONG cons Par child destwelos exe 5 eq vent dese. KE Cuved i Gane 8 oS} bye complete, counpleseis inter 4 ; a ccezaz ko itz own Addrerg Every object in Cre “hop ac A shia pointer, Aarough Qn Amportant peinter allied ie Y G } inter, fe oo Friend > function doegn’+ Wave a “tnix | goiter, iD f feerds ave not Member, of a claag. On\y member funerioy have thi pointer: Prinote " i far 2b | public Boe yun b: e@ (S10, Hy; Meknod Over Ridin fachieved - am run ay 8) aD 28 Tr etre @ ve defiritioni sot 4 “aaa derived elas, with Same return, __ type a4 private + Ant gearne pebliten ~ Notd, ehange geo r CBnt ger) cs ¢ qr boi > y Cosa SporiaGr + public Gar 4 Void Change.qearC Ynt gear) i ML gear > 55) I COT e+ 5 a ; { ant _mdin q Sports Cac Bex c+ Change-gear (4) ) ad AJ Co 5 ) fonction of sporis@r Crass will be called. eon While calling Change-qear©) , first Fe check TF any fon _ With ania. Gnome! exic+ in Laces 28, otnerwi capip W goez -yo ake Clacs » 3 Use 2 ike we Nove . Change-qear fer ail excepr_one & Suinicn Nave Unig oe: mene d oF oaeariG 4BRK “Shigma) “4 Nivtval Function” . A Nirtwal fonction ig @ member function which Wis declared with ‘virial KeyWord’ in “Me base and ve declared Coverridden) in a dered class. When you refer +o an object of derived Closz us} pointer to a base clagz,, you con call a \virtvat Foner Toh tate abject ond execute, the derived claga’g | Nersion of -tne function, * Wey are used +o achieve Run time Foly mer phism « + Virtual Function Cannot be Static and also cannot be Fri function of anotrer class. Compile-time CEarly binding) Vs Run_sime (hate Ginding VU Closs base 4 Public + Nirwal void. Prins ©) 4 Source “ This ia bose print” os+ime opin pois 40 Ane. Wiobject ot clase deyiwed, 30 SH Will bf eind funtion Oo derived at Ton sime. Working of Nivtual Function CNTabie > 2 NPtr) ta class) Cahtalns Virtual -fonorton hen Compiler tselé edoesi) two anings + , 4 A Nivrval~ pointer Gere) iS. Created everytime ob) 15 creates for -tnat class which Commins _vitral fonction. object \s CYeated or or, Static ea\\ed NiTABLE ~ Where” nen Celi polm fonction \2 creared, im boge R “Xrespective of >) array of) pointer 40 each vith Clase ana aexiNed Class,9 \ amit vd \\ whoa = N TABLE P| St a1 han oD NV at Pure Nivtyal Function ew and abstract Closs enibnid yes pie Sometimes implementation of ail function nner Al fim Hhes base, claaz , Suen a Qrass ig caned Gasitre i me = = drawO 22a 7 ere 9 Get sneres alte 4 re implementation y 2 ; 1 ST rewe Square | fon 44 ANipore svirtual Haniction sain crs Ba Vanigal which ¢ we. don't have any “implementation, eee YU Abstract Class Grt9y 2 Chossy rege VolfanUF IPYUTMY. to VAIO, Pet stewsh a Pubic: Qur a? pao ost Nitta via fen =05 > bSiteSay = tages cess ie Beers aa Ae ae a at le 2508 pure . virtual > function, ») fa. pea RESID ‘yr lasb Seve gannot declare “object of 6 ales trace Cac Et Ries Sieutes Che hie ot Sep a
You might also like
Oop
PDF
No ratings yet
Oop
20 pages
OOPS Handwritten Notes
PDF
No ratings yet
OOPS Handwritten Notes
20 pages
Oops Notes Curated by Sameer Raza
PDF
No ratings yet
Oops Notes Curated by Sameer Raza
21 pages
Oops Using C++ Unit 1-4
PDF
No ratings yet
Oops Using C++ Unit 1-4
187 pages
OOPs Notes in C++ by Arpit Singh
PDF
100% (1)
OOPs Notes in C++ by Arpit Singh
20 pages
C++ Hand Written Notes
PDF
No ratings yet
C++ Hand Written Notes
15 pages
Imgtopdf 2909221401056
PDF
No ratings yet
Imgtopdf 2909221401056
39 pages
Oops in c++ INTERVIEW ️SERIES -2 _
PDF
No ratings yet
Oops in c++ INTERVIEW ️SERIES -2 _
24 pages
Oops
PDF
No ratings yet
Oops
21 pages
OOP Prelim Paper Solution
PDF
No ratings yet
OOP Prelim Paper Solution
27 pages
C++ Notes FULL - Compressed
PDF
No ratings yet
C++ Notes FULL - Compressed
176 pages
Opp's Assignment2
PDF
No ratings yet
Opp's Assignment2
12 pages
CPP Notes - 02
PDF
No ratings yet
CPP Notes - 02
30 pages
Oops Assignment
PDF
No ratings yet
Oops Assignment
11 pages
12304005N54272 46960 Oop-1
PDF
No ratings yet
12304005N54272 46960 Oop-1
9 pages
cpp-programming-notes
PDF
No ratings yet
cpp-programming-notes
80 pages
CPP Notes - 01
PDF
No ratings yet
CPP Notes - 01
30 pages
Endsem Paper 3
PDF
No ratings yet
Endsem Paper 3
45 pages
OOPS
PDF
No ratings yet
OOPS
53 pages
Chapter No-02. Functions and Constructors.
PDF
No ratings yet
Chapter No-02. Functions and Constructors.
27 pages
?oops?interview Series
PDF
No ratings yet
?oops?interview Series
10 pages
OOPS Interview Questions
PDF
No ratings yet
OOPS Interview Questions
28 pages
Oops 03
PDF
No ratings yet
Oops 03
14 pages
C++ Notes Complet
PDF
No ratings yet
C++ Notes Complet
144 pages
OOPS Handwritten Notes
PDF
100% (4)
OOPS Handwritten Notes
10 pages
OOP assignment No 2
PDF
No ratings yet
OOP assignment No 2
10 pages
C193243 Cse-1221 PDF
PDF
No ratings yet
C193243 Cse-1221 PDF
28 pages
C++ Notes Complete
PDF
67% (6)
C++ Notes Complete
145 pages
DocScanner 30 Sept 2024 2 33 PM
PDF
No ratings yet
DocScanner 30 Sept 2024 2 33 PM
12 pages
OOP Practical
PDF
No ratings yet
OOP Practical
30 pages
Oop's Unit (3 6)
PDF
No ratings yet
Oop's Unit (3 6)
45 pages
C++ Notes Complet
PDF
No ratings yet
C++ Notes Complet
146 pages
C++ Interview Questions 2
PDF
No ratings yet
C++ Interview Questions 2
6 pages
Oops 02
PDF
No ratings yet
Oops 02
25 pages
OOSD
PDF
No ratings yet
OOSD
20 pages
CPP Notes - 03
PDF
No ratings yet
CPP Notes - 03
30 pages
C++ (Unit-3) No Operator Overloading
PDF
No ratings yet
C++ (Unit-3) No Operator Overloading
21 pages
Advanced Programming c412
PDF
No ratings yet
Advanced Programming c412
133 pages
OOSD UNIT 5
PDF
No ratings yet
OOSD UNIT 5
27 pages
Virtual University CS304 Object Oriented Programming Final Term 2012 Subjective Solved Past Papers by Moaaz
PDF
No ratings yet
Virtual University CS304 Object Oriented Programming Final Term 2012 Subjective Solved Past Papers by Moaaz
6 pages
C++ English
PDF
No ratings yet
C++ English
513 pages
CS201 Handwritten Short Notes (VUAnswer - Com) Handwritten
PDF
No ratings yet
CS201 Handwritten Short Notes (VUAnswer - Com) Handwritten
13 pages
OOP Lab Material
PDF
No ratings yet
OOP Lab Material
94 pages
OOPS in C++
PDF
No ratings yet
OOPS in C++
15 pages
Adobe Scan 19 Oct 2024
PDF
No ratings yet
Adobe Scan 19 Oct 2024
20 pages
Industrial Training File
PDF
No ratings yet
Industrial Training File
29 pages
Oop-End-Sem-Full-Oop - Proper Decode
PDF
100% (1)
Oop-End-Sem-Full-Oop - Proper Decode
48 pages
CPP
PDF
No ratings yet
CPP
116 pages
PCPF ?
PDF
No ratings yet
PCPF ?
35 pages
Oct 24 Bba (CA) Cpp Solution
PDF
No ratings yet
Oct 24 Bba (CA) Cpp Solution
11 pages
opp ass2
PDF
No ratings yet
opp ass2
10 pages
Teach Yourself CNC
PDF
0% (1)
Teach Yourself CNC
605 pages
OOP Ques
PDF
No ratings yet
OOP Ques
10 pages
Computer Programing Lab PDF
PDF
No ratings yet
Computer Programing Lab PDF
105 pages
Oops 7828 4761210891
PDF
No ratings yet
Oops 7828 4761210891
26 pages
PE-2023-Cpp-Lecture-03
PDF
No ratings yet
PE-2023-Cpp-Lecture-03
85 pages
OOP QB Answers
PDF
No ratings yet
OOP QB Answers
17 pages
cet_question_bank
PDF
No ratings yet
cet_question_bank
32 pages
Unit4 1
PDF
No ratings yet
Unit4 1
112 pages
Inheritance
PDF
No ratings yet
Inheritance
23 pages
Object Slicing
PDF
No ratings yet
Object Slicing
30 pages