You are on page 1of 10
ddceddddd dees vo \ yveons \ AY } Sassyoob \ \ ae 4. [uahar ts 90 2] = OOP Is qbbveviared os _Onject Orlented Programming, Sys tn wntcn Programs are Considered Qs @ collection OF Obfeuts. Eath objer ts nothing bur an Inctanu of @ Class. 2: [Wisite baste concerts of 00? 2] > Foilostng are tne concepts OOP and are as Follows : 1. Abstraction 2. Encapsulation. 3. Innevitanw 4. Polymorphism: 3-|whar isa class 2? 2 A class is Simply a Fepresentation oF @ type OF Objet it ts the blue/Plan/ tempiare, tnar descxtoe tre duals oF a2 obser: AR CLINKED] es Neves Guecery Creley 4.| nor ts an objenr2 =) Onseur Js teymed 95 an Instane of a Class, and tt has Its Own stare, behaviouy and fdentity. 5. | ponar is Encapsularton 2 > Encopsularton 1g an attribure of an object, and Tr contains gi) dota Nth is hidden. Thor nidden data can be yesrrtcred to the member OF that class+ Levels are Public, Prorected, Private, Internal and Protected Internal. & | iWner ts Poiymorpnism 2 2 Foiymoxpnism is notning but assigning behavior oy value in @ subclass to Something thar Was giveady declared in ene Main CIALS. LIMPIY, PolyMorPHism fous more LOLLUGCEC ded ee ee eee rr” ? Inhwitane ts 9 concept voheve one Class shares the Structure And benavior defined In another class. Tf tnhevitanw applied On one class ig catled_cingte Inhevitanw,and I6 It depends on muttpie classes, then ttis called multiple Inhevitane. -Lawnat_are Manipulators 2] Manipulators are tut funutons whlch can be used In Conjuufon With tne Insertion and extraction operators onan obser Examples ave endl and ser - 9.| Define a constyucror? ? Construrroy 15 q method used to fnitlglize ta stare of an Objer, and Tt get Invoked ar tne thme of Objew creation - KRwies for Conspyucroy are! howd be sqm oTes GALeeRY C TEC 10. | Define Destructor 2 a Qe > Destruutor ts @ method Wen Ts quromatteatly called whin pe objer fe made of Scope OF sestroyed. Destrutture name fs adso Same as class name bur with pu Hide Symbo) before pu name. te| Whar ts Initne functon 2 > Tntine Funuton ts Feehnique Used by tre Compilers and Insrrucre po Insert vompiare body OF prt Fynutton whereever tar Funurton fs used In pry Pregyam Souvu (odes 12 [anak i's virtua) Punaton | ~? \ixtuot Funuton ts @ member funutton of class and ‘its Functonaltty Can be Overridden In Irs devived class: This Funutton can be Implemented by using a Keyword called virtual, and tt can be Swen during Function declaratfon- Virtual funurton can be achfeved tn Ctt and fit can be Qthtaved In C Language by using funution pointers or Pointers to Function Friend Funeton ts a Friend of q class phar ls qiowed to access fo Public, Private, Proreured, dara In thor same Class. I€ tm Function js defined outside tu Class cannot access suth Infoymarion- Friend an be declared any vohere in the class detlavarfon and t+ cannot be affetted by Qecess contro) KeyWords Like Pxlvare , public of proteured: U-[lAlnar fs Funetton dverloasing 2 > Funulon overloading ts defined as a normn function, bur ft has the ability to Perform different tasks» It Qnows Creatton of sever methods with tre same name Ldnith Atefey From eath other by type oF Input and Ourpur oF the funutton. 15+ | har is Operator Overloading 2 > Operator Overloading ts 9 Function Where Arent operators aye applied and depends on pu QiQuments - Operator, — x can be used to PALS tNroUgh pe Functton, and ft nas tnely OWN Precedenu to execute « a prucmumpar (LINKEDIN), WeMassssoooboo00bLeddrtdced ddd dd edd’ a cece vuecedcedced 5 Bav_vo Vw.vvov veOwowvvov vo vy 16. [yan ar fs an abstract class > Ang Tate class Ps oq class Which cannot be tnstantlated. Creatton of an objet 2s not possible wlth abstraur class, bur tt can be Inherited: An abstrau class can contain Only Adstracr method: Java aslowds oniy abstraur Method tn abstvat class wONhle For Orney language tr alloWs non-ghstraur method qs Wells ttc a ternary operator? > Teynaiy Opevaroy ts sald fo be an Operaroy LOWch Fakes THLE AHQUMents. AvQumenrs and yesults are OF SIEFOent Gara types, and It fs depends on the Function. Ternary Operatoy fs atso called qs COndiHono) opevaror» Aru fuga e CUNK: 18.| lalnar V5 the Use of Finalize metnod 7 > Flnaitze merhod naps fo Perform cleanup operations on the resources WHIch are not cuyrentiy used= Finouize muthod 1s pyorered,and Yt Is qecessible only phrough tris class oy by q derived class. 19. rinax ave sPForenr types of arguments? | 3 A parameter Is a uarlabte used during tre declavation of rue Funerton oF subyouttne and arguments ave passed 4o + funuton , and tr snowd mareh colt tre Paramerer defined ere ave tW0 types OF Arguments. © Call by value — Value Passed voll! get modtFied only Petes Funurton and tt yerurns tne same value wonarevey Ir ts Passed tt Into +ne Funerion . ° Can by ReFerend — value Passed WIN! ger modified in hotnigide and Ourside tm funtttons and Mt yerurns try came Or different Value. Atuc Kumar © FD Super kay word fe used to fnuolke overvidden method whlch overrides one of Its Superclass methods. Tris Keywerd allows to qcess overridden methods and also to access Hfdaen members of pre soperelg s5~ Tk also forOaids 9 cal from q conshutroy to a wnstyuctor IN tre Superelass. ~ lwtnar ts mrumed Ovecviaing 2 = ee overriding, Ys a Foaruve tnor allows subclass 40 Proulde Implementarton oF a mutnod Mor fs alyeady Seftned In tre man class. Te potty overrides Hre Implementarion tn me superclass by prowiding pre same MUNOd NAME, same ParAaMereY and same yatuYn type: hot fs an Interface 2 Ain YnterFaw Ys @ collection of abstract method - IF the Class impiementc an Ynheritanu , and phen Mereby Vnherits ol) tat abstratr munods of an Jnrerfau. 23-|lAlnat fe an exceptton nandiing 2 > Exuptton is an event tnar occurs during tre execution oF a Progyam + Exceptions can be of any type — Runtime exception, Exvor exceptons + Those exceprons are nandled properly through exce ptton handling mMecnanicm We try, caren and throw Key words 24-[inmar ate tokens 2 2 Tekan Is rewgnized by 9 ompitey and Ir cannot be broicen down Tnto compenent elements. Keyword ¢, tent fey] constants, String ilterale Ana operarorys are exampresof qorans. Even punctuation charaters are also tonsidered as yojans — Rrackets, commas, graces and Faventheses, WSS LELLOLELEIECCCEe ee : bbe SSS Ne WSSSSSELELLLOLECEdE ede eee see = = — 25-[DieFerence bjvd overloading and Overiding 7 | 2s Overtoaping 2 OVERRIDING + Overloading Is statte binding. J» Overrfding is dynamic binding. + Overloading Vs norktng bur pra fo Overviding Ts tre same SAME meriod calen ait Fervent Method Name with same Arguments, and Tt mayor may] arguments and return not veturn the same vatue in | types ascoctares wlth treclass tre SAME class Ttsele. and {ts cnfid cies re [DlsFevenu Ble ciate ang an opjeer?] 2 OBsect CLASS © An objet isan tnstang ofa fe Class don't have any Class odjeus nold any Information. informarion. © Objet does not have © Class can hawe sub- classes. Sub - Obs Urs 23-|Winar Ys an abstrarton 2 2 Poctraction ts Q geod feature of OOP and St shows only Pe Necessary arrallc to tre clfant ofan ebjers Means, Tr shows only necessary dautslls for an object, nor the Ynney deralls of an objeur. Example — When you Wank to Stottch On relewision , tf net Necessary +0 snow ail tre funuttons of Tw. \narener ts vequlved to sutten on Ty ott! be Showed by using abstyaer cigss. 2%-| nar are access moat ter? D> Access moaifler determine th Scope oF tr muthod or variapies thar can be accessed from Orner various obletr or classes. There are 5 types of access modifiers, and they are Qs Follows ¢ © Private 2 ecre e Publte » rend © protected Frlend. a Ate _kualan Coed keo Note Gacer¥ CTELE GRAM) eccceeededed eee vuee } u | VO VYLVVOOE 1, aaa \y\ ‘ys yO Sy \ 29.[talnar ts seated Modifrers 2] > Seated modifters ave the access modthfers wnere St Cannot be Inhevited by the methods: Cealed modifrers CAN alsO be appited to PropevHers, events and methods: Ts modifiey cannot be appiled to static members. 30.[How Can we cai! tha base method ufrhour creating an Ins tang 2 Ves, fF ¥s possible to call tee base method ulrhour Creating an Ynstana. And thar method shoud be, startle maumod- Dotng Inhevitane from thar class. — use Base Kay word From derived class. BieLwinar Ys tra dleeerence b/w new and overvise? | 2 Te new modifler Instrude tre compiler to Use pra new IMpiementorlon Instead of tre base class funuton . lameveas, Override modtfler haps to override the base class funuton. 52-[Wwnar are tre Vavlous types OF Construcrors? | > TREre ave three varlous types of Constvuyerts, and they are Qs Foros i. Default Constructor —Lultn no pavamerers. * Favamarstc Constvuctey — tiith Paramerers - Create a new Instane of 4 class and also passing arguments simultaneously. * Cory constyuuor — Which cyeares q new obsecras q copy of an existng objet. 23. [ilnar ts early and hate binding ? 3 Early binding yeFers t0 F6signmenr oF Values to Uarlables during design me Whereas tare bindin yefers to assignment of Values to variables during LIA EDINI)- Su [nor ts —tnis Polnter 2 | => THIS potntey vefers to the current Objet of a class IMIS Keyword ts used usa pointer Which aifFerentfates Barren she current objeer with the global Object. Bastealy , tt yerers }O Pu curtent objent+ NF Povenee b/w ‘tru _ =e 5 s.[manar te the ure anda class? | 2 Staucture CLASS eee Goes © Styucture default access tyre [> Class access type fs Ts Pulte erivare . © Struccure TS used for qvouping}® class can be Used Fo grouping dara. dara and methods © styucrures ave exclusively © Classes are Used fo encapsuu- USCA for dota and I} does not] Ares and tnhevit dara wWrich yequiye The default access mostAter of a class ts Prtvare by default} liner ts Pure vivtuol Function 2 > A pure virtust Function is q Funuton Nth can be overridden In the devived class bur Cannot be defined. A utytuod Funurton can be declared qs Fure by using tre operator =O. 39.[har are QY tha Operaroys +nat cannot be Overloadeay] =D Following ave the Qperarors tnar cannot be overloaded 4. scope” Resorutton ( 2. Member Serettfon (.) 3 Member selection tnrougn a polnter to Funutfon (x) WOKOVOYH LOLLLLEDEGEC CELE CC CCC ESC EE y SS LoDOLLULEbCLLEC ECC Cee eM SEY Sarsis)d yy yb Ny % cm 2] *) Dynamic ox Run time Polymorprism ts also Known as method overriding tn LnIch call to an Overyidden Funecton ts yesoived during yun tle, nor ar tre Complle times Tk means Nauing two of move metnods volrn tr came name, There uot be alway $ only on COPY Construttor that can be elther defined by ne uset Or Tht Sycrem « 42.) menod definition 2 3 It moans, We can averyide the method. + latnerher ctabic method can use non «static member? | Folse. uu. [winar are base class, Sub class QNd Super class? ] 3D Base class 1s te most aeneraiized class and I Is said jo bea yoot class. Sub class 15 Q class that Innevits FrOM ON OY MOTe base ClASS+ Super class Ts Are parene class From vonich anorher class tnnevihs: mark CLNKEDIAL). a OVW eLLLLOEVEdC EEE ee eee e/e’e’c i ys. [ponox V5 Staric and dynamic binding? | > Binding 15 notring bur rrr Assodanion of q name wlth tre class. © Startle Stadlr QI-AS a binding in With name can be Assedartd wlth the class during compilarion time, and Vr is also caned gs indi sDunamle Bin Sings sa conan Yn wWNch name can be assodated wim me class during exeuution time, and ?t 1S also called as_sare Binding . Ub. How many Instance | can de created for an abstvacr class?) 4 =’yvo |nstanus vsti be cytared Foy an abstvauw Class ur-[panien Keyword ¢ “ean be used tor Overloading 2] \s used fey Overloading. 3 Operaroy Keyword us-[vinar Ts. AL default access spedpier in a class definlHon? | > Fruare access spedPler Is used In Q Class deFiniHon. uQ.| Inich OOPS Concept is used For yeuse mechanism 2] 2 Innerttony is the OOPS Conupt that can be used as yeuse maothanism. = fanich OOPS CoNnLePt exposes only NecessSArY Informatton| 4o calling Funuton ? 2 Data tHiding / Abstraction LINIKEDIN.).

You might also like