0% found this document useful (0 votes)
38 views5 pages

1683044825934

Uploaded by

Sandeep Reddy
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)
38 views5 pages

1683044825934

Uploaded by

Sandeep Reddy
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/ 5
€: oguies he properties fom one chysto then chases porunt and chilbssn, relattomhip Epes: nsigh:tdeng Note of ene cupeday las 9 sas pap ocd & Mulltple support le thheulance Ms nD © tucuand torexterd both ade clue Coviaithd: —fitan we con coll sas a enable testance Wo dybieds wtf ihere aie Sarre methads to chs A ord chs +f a ederd bol sate claxsC then’ wll get confused wether +f #5 fern cas4 @ chs B- Geeta s_Concep = [ wecht ce of chs = which constsh las object + abject fs an tadlan of methads and propedtes. They have states » behavicun Tenale on obted: (Ted 4 2 est FES) claws’ collection of methods » objeds-whtch hae mages peClax t5 @ sof of abject whtch shanes commen charcctris and attaibudes: ; | class ts agroup of variables d dtfluent datatype and goup of methedg| “class does not ccesipy memory: Aiea fee) | > Inhesitance £ Aquires the properles from one class to ancthen Gloues- /2n which one class ts allow to inherit the fecdunes of ancthey claws = 14 % an fnporlant part of ops : me For de Reusabtiy a i culls exlerds superdas-name d ubelass-name e super : Umbbods » frelds y sere resee? 2 P $e - ead 0 Inbettances In tis we have onlyGne parent and cne child? (ry Multtlevell Inheritance :- In thes type we hove +» Chase chss->Tnlermedtale chit» child cbsSp (ut) Muttiple toberitance ~ 2 parent clesses 8 4 chrld clavs.. 4In java multiple aberitance not allowed — Sif bow superclass [panent clus will have same fortunes thn it eat e mba Compaen). 4 : en : ()Htewschical fhestonce = ee nd, 2 child « : &) ytd inhevlance + Mull mbeslone 4 Heo! whuitance _D PDP PPP PHP O RR D2 © Peagnarnt tmpart java. ult Seanres 5 publ class FibonacciCaludase { PS vm (String cog) ‘ 80h (Crler qu up eokich Abaracet series to putt) | tat mumber = new Scanner(Systens: in) -nedtTat 0) 5 | Soph C*Fbenacct series upto “+ rumber #.° numbers 25 ri (Bt 245 tesmurbey 5 244) = Soph (fbonaciz) +" *)5 ' 5 | SD Mutple Thallence ree porstble , So we carst do hybitd toheutance - lm 3 Huttiple inheutance 2 possible using toterface concept pd ; “ ‘pleads beyeocid 8 Draymorphesmn’ By wih poymerphtsm we do perform a sigle acltan in SD differed ways mi Lypesle) = aNcomprh-time paymaplismr g G)kaunlfme polymorphtsm - SB Lie can perform polymorphism to fava by method overloading 2 method 5 3 ES oventicli 61) compile-time Polymorphtsm = / ‘ S® Ly stati polymophtem/slatic. Binding /Eauly Bindi : —®@ srs es Palyrmesphisin 45 ne “4 rtelhod Crerbadling, W oh; hiheo ther ultiple method= at > (optne Ale ee ae ee eae ay Dynamic Binding /iole Binalng er ‘ y Ths type of polynaphtsm 2s acheied by Method ovewsidl : Same name & Same parameters : = Melhd overhang : asheala’ Baits : ‘ he super chss usll be hiddeo by ene subebis ts kro ‘a (BSCE EEETE PANIS® 1s a beypoodd eich ekers to uexrent ckyect 3H anke oT refer instance variable of cuwent chss Ls 2H ante used to toveke/inittate current class conshaucte?- > Hcante paved asan axgument inthe meted call ST canbe passed as an ert: in the canshuncter call SIt canbe used toreluny the cunrent clos tastance- 9 Super Super ts a keywords whtch refers to parent class He can access all alate anbo-dalte members to child chss - Super keyword should not use to stale block /mnetfeds: . The most common use of Super keyword 15 thal # eltinincdes the cordasfon bf the Superclasies and subclaste® that have methods wih sume name one % 9 non-eccess modifies applicable only toa vawable,'a metas “f @)aclex - : i > final *s used vavabk means, variable value ts xed and we canot- @m tottalized/modity rt again. e +} Final eeyeood wth methed name then we cannot override but we ov e ALS good prc fo wpesnt fl vacates in oll uppercase, ustg vedo rerarrrrrt to seperte ards): Sprfference bls Tnterace : claw ~ wrobjeds cannot be created adobjeck of the clxs can be created ~ @) Supported én enultiple tnheritance .|@) Multiple foheritance not supported @ ©)Cannot inherit a class + °° » |G) Can inherit w claxs e (4) Methods » Vaxiable ax€ public only Joy The acéess-speciffeys Use d with @& ; classes are pyiuutes protected. publre @ © implement an interface we use |@)A class canbe soheukd astyg e the foplements kode ee © lee he cael e > Interface: es muiok asbetone ; - . 2 does rot contain censtueldis, coctai abshuact enethods - + By default soterface abstract Sie ct pubes rey - Encapsulation + Meppig up of okt ax under a stage unit : é ag of eayeant to makeane ted Sensitive” dela & hidden fo usens « ies | . hy. s mi H Cee ee vosotles|atfateties os che aa «prove pubie kor ot mehak to aces oe upd Prlale vruable + , SB 3 Fe gel method rehunns the vaniatle value, ard the set melbod sel the value! As tn Encapsulation: the dda in a class hidden fem they classes wstn kde hiding concept cohich is acheived bi making the members Gn heed of a.clys pitede \ ‘ i Ercapsulatton ts adveived by declaring all the variables tthe clas as Prfvede ancl wottting pubhe methods in the claw to set and get the values of WD variables : - age acheiut ~ eva harg declare vaviabkes aS private @Incesed Fleabrity ne ¥ ie &) Rewabtlt: provide public gel yal QM estng cod ts fasy. to accesand le re value ofa prtidle O@Abshucltons shaus only essential attbudes and “tides” unnecessary Infaweal tons of abslgecton tshiding the unecessary dolal8 fom the “The mein USES, a 4 , ‘aa abstraction may also be defined os the procers of eho fytag only the Aer foray Acaacsles ofan object groring she felevant details Abstraction #5 a proces of hiding tmpkmentatton detatls and showing only SS findiorality $0 the wer = Types: @) ® Ccenuele Metheds: (The methods which are having body’) ee cane welape kan peeing. meld Named) “Si: ”s Steuternends oe “D @)Abshad Methals: (he melheds which ane not having beds) ~ ae Medtfie vehanpefekurlypentlhig relhodnlame¢) ~@ -11F we brow weed came, but dont koo the method functonality + £1 abshyact metheds 2 ey 7 Tava class contains 400% conciele Hetheds « ~*~ 7 Abstask claws contains enefmore abstract methods. > @ Iolerface & An herface 8 a colleckon of ad rethods. used to Spectty the behavtewy of arcas » ae = hie use the tinplemeals | She toterface used to a ne ee abstaact _ methods th the java mntenface, not the ond pas & en (ATER asedto sen en Rmaltple by bce. fa Pen esiD shot set ee \aniabhs." but the methab dec do acheive a, ete

You might also like