0% found this document useful (0 votes)
23 views

Java 4

Uploaded by

Geethika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
23 views

Java 4

Uploaded by

Geethika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 54
wo ontralige vay f ol ten we eek ven deere ony wie pecitay Loe ua 484 fo ¢' enoutd Geeaaee Scanned with CamScanner F system Ot prratin(g r 5 y 5 cobputs 18 yi 4 > hue. y # HR's on, 4 3 a 4 3 i rife Loop. isthe peiality Of Condition tn java ts , the tonditina fomfalse gould -§0% Soolan valle ay -elult white eop thoutd produce either Tue twrntahe! value mld fue Place Tue Maen acue) 4 Z [i thu) witt-on infinite T apterm-outpantio(i) (oop ut meentin Ct NIshou") over loop Hf we aap Stakment after Pe ete Unendk nat there U Scanned with CamScanner nowed while eae sone Car ea ot © Qe econo E i qurtiop fy Wiel sal ea 33 es ey 3 4 Bile > ome 8 yas 1% rid pont: a rite ane 0 Gedy jae? am | biog ear rile * Qublic claw Tak newea hie? ( public Static void mein(sring erat tnt 19 white CiZ=2) hile VE=2)R encral fm tat jj) E \n¢ white (J 2-3)f RAN Siero peace ts lt eae Tere q Lceite, Cons J 3 a A J = pda Public clam ertrvestedioh 5 isveatied! uk publ Wold marn( Sming cq Statement ‘ . - V Prog race (nt i=10,}-20 q hile (Ht grande Clon Cask fern -outsprinitin¢ i). '5 Puble ‘sic Scanned with CamScanner => Cowal everated : Othing, wil eat “ot midpoint: outpl ve cine ce Sody fe thamy white op tr Sm-while loop Make = 1 ey che ae ' 4 aeex Do which generally wet Br ffmrena Drven'eo % Pregam © i nen Sey, {nnport java-usl #5 doe loop : Clam Testdo Lohile enuf _5 ungt Common loop public static Wid main ( Stung opt DE ed Y=20, cholce ; Seanney S¢ = ew Sener pn tt * Gumi Doren we abveode : 1p we work tome ‘ « Yead input fem a wx claus tat ("y Addition 2: subtraction ¢ He oe * ( intial (CEnier Your choice); © = 80. nexkantl); & Reading the inkegr \ seen tank J Su HeN( cho case | Siplern-out-preatin(" x4q2 "+ Gay) brea} Scanned with CamScanner ae 2 System-out- Printing OR eabe > * Systern: out Printincn jeaeg 8 default = i ee fuohile Convice >=1 8G choice ¢ D3 Peay Sypieen: Dut print (4 Git puts sokvehces, | A-e0 LAL Selecho, Gu loop 5 wast Common loop with 2 foamy — ead Zenner ; s Cyem-in) { aval choice 1 aa TUMPCE OF Herattons. DD) baie 5 mY 5-10 enter Crotce £4 UY 30 Ener cote +3 xy" 200 | Spvalid choice sroditional ‘for ~Enfranced for Case Scanned with CamScanner Ce omer ne CCK Retin a | pion cut printn(s @ eee aake Vord main( Scanned with CamScanner a aoe Ct t= @lehgth= 5 1> Os f= y Syptern: out print a.ci3) +, 4 3 ¢ i Jeastior claws il 9 ube static void main sring arpeyg a <\ veb=u, acb ant baa) Exanaite voit sr : ‘a Sten e type ag sevcgute print [lg 6 AFA) roy my Out F pice aa @ustem -out: printla(s py, !! +bYd Sepak by ago oul aa np 1 output J BSI J ° (we Can hove diferent Hinds Of nf Shing arqst Nanebiel) Scanned with CamScanner woe ave, nok ba Cee. Ren ¢ Oe inoligaton’ ond a ee one ar ost tytn oooh pe? | fey tt Ly tere ne Hr lg : ax Gaderionall Fara starting and "ending LS thot” pected! “ange got (10 At ince ogee oat pet ott execpt -Arrayout ef eound meer oe eee rosm commen! Cnceptia nL = 24105 per emcan Vaveid Suter kind” of erator tor i each , we need not to bother about theration, hog 2° ow alizatio?* oe fh Loop thee & no Uy fo print Se i v At Cink} = Ky fecaur Shictly Sequence ve Sc Vine fon OF SN) _, om um) ro) -out: prio ay pe eat 2y 1 2 on Sp Oy . 11 MNS oo 8 “ow oo Bo0$e: RO Scanned with CamScanner eft i foitcig tL Sresen “$0, > 34,54 pee G Mm oy (ine fhe OR rie we get “Gemunt tn ans oyster - Out prentingac)s mon! Exception, PCS IOY gion A. for J Ne ‘on n © awal (t ikeverbion, erating © i fo'prn t SrCtatcy % @ fr Vea yp wea) ¢ ystrn OE pr An t { y , 5 6 fern ott: prratin] \ sano? /-t-gum), y output vray ( Scanned with CamScanner 35 : oO pore parent (4) 9 ote’ oul apen ued for “ae _> gearching an Wnnatted eral 5 for Cie TENG ng very Foc Cea | n and) max elem , min a \ Scanned with CamScanner got 100" a Mee tint feo j 1et0; MY ‘3 i ig(re=s) 2 a jared — > eactern oc? PON a edaterre tK , output swcink (217; 14585 i 1 5 3°" 2 a k 50 \ Ractennepeg3d Xo aPR ‘ 2 4-( f2=dD 1 break, ‘ break y coke ee Scanned with CamScanner reer eepvetty vemirn ot Te ye oe nat OM r. ye if ie . Dre gee) ae Oe ee pele! fee peer pubic stole \ 2 - q 2 ‘Ob VAC 2 . i T t : wid! ote! usd” ra euip cament Cercdhon. “Teco! frrug will Relp ws b skp meh Soon ment berate) ag e bir e lam” Tes ibwe Static. \oid and go f° - wtf puc clon Tt] He wid mauni(shntng © 2) pal ar cnt 7) Sysieon: Ou dor Crt {205 145; IHF 4 ee Ny Os Duper Shing | 5 pu 8 continue) : Sater Out pantie . 3) 0 > procedural Uneor Se Unrclurcling Far chdon Scanned with CamScanner ree? 5 eeptenty TRIN OM a wetted, . jp ue care nob hing netics arin pct eka ebar to He caular metrod , : eeu gubice stotic vord main( Sing ante D)e Fm cour method ages ovge. 3 $ catted method aifged fo aber athe. Control h.*™ ie ethos) type. compatabil Void ncn (StangiC ANG g output Sudha [ob avged); Hat) A of Program 40) | comperter Scanned with CamScanner > Umiation’ & Complexity 25 hen Re ‘Problem de gettong 4ne programe Unable 40. Undersiang iO poe ox technique on Proiem qandle this Cr fine program , the uoderstonding of ote . of Procedural > af complexity ,eoereare Guman beng about the proienn desveares 5 “To ovextome <5 At last ve Give up, thi» Fappermin p-Oj5, series of Set OF Unshuchion’ thet we object peers ; arenple to Te Gor Beyond certain: 35. a object, | fanding the programeree objec pony tae progeam.md dG prog MTC _ sotalol ahty seomtiouce fitieee -Cney q to hondle ¢ > MoeP a Mechanism. O& ther® Should Comraunicet L bechnigue oF dology 4 Which we coq candle thin Complexity and & ve Can utem > aor eM 5 echnique Or methodology i not) Sunckond ; i 6 ar Scanned with CamScanner ‘ ha eA prorat RK 8 taath and torgos chomue ov mnethodolg By» rg C1 ie yrable 4 urdrrcton die this CroPplertty oft he ebjet ented Ureitattons Scanned with CamScanner PF Neat andi cool? “ 2, cormpared Sie Moke Moab queue laws Arvay Matt public Stalie Vp | 4 G2P nbiternase kode —00P. qi us better paeirtalare todec a ee motored rir: {e070 a Roc &- Say, fo document : ba tor an 25 we can, eanily ‘documenta oP propa ba’? te caper compas © POP 5 Easy Fo, eplata & 2 Voy easy Questing everqthing in object oriented Presjrtiontiy iS ts obytt y we Cam aeprecdent vaing om 2%/clp Aogritre and ‘easy to explain sto Fearn oie to explain abo betause Scanned with CamScanner ; 72 Wohe Mudlighialinrs MA = Pic laws Ary Mullphcntong fap Pe puke” Staite 1 main rr anger) i COP ers I0 TL deay, CereneN cot eG.) 5 fy nt Rese dort s0F meq. | Res _ Pry four tnt to3Cz) eae ee) Aer evahnk x00 Beta Ja) Seton whe. Gloom clause Hp sa einy no nantes i v2 i for (K=O KCB SRA DING sr spore | $4 ch) pee) mn member, . ee ‘ , Secon ve prat Cee Acti Mp tara pant tres une Scanned with CamScanner g eystern out prictin One DE? aienizet™ a — and Stviog OE 3 a wed for storing tet Achice ta : of charatkers SUivanded (ave ate 90%. Ime 2d. 5 rome Boe we begt ae a Gow ope bobo prededin 64 double Year ove OF os OF oe a vorinble OF re Smy and On'gr ead hay teat ; get rae paride Stedic YOId, ma [eee eee ] ae string Cergth aipdeon-ouk pan SA eg io ja os. eto on object , Which spem out “pri cont nneticds that Tear "penser Certain _ 5 output mpratonn on strings’ for expwnple, the Cengtn e ed per qth ot a ipting com be found with the CEngthc) v preter = Bindi oq va steing | T-stving txt = “/BCDEFGHITKLMNOPaRsTUVI™ | > ThE endex of¢! astern out-printin ("the length of position) of the text tr a Shin State Void. mata/eh | Ing ac) £ Suing u qv ing Get ABCDEE GY ie SK UMNO pop Jaya counts Tosittio Scanned with CamScanner tem ut prrntin CoThe “f Ferg of nae GOMES ae Ten the te 4 OF the tt string V ShIPe Van ra, irainde pumine 1AM Named E, a cay vest { it aw @ Mee page, Stelic YORI, main (Sminepovgddt Sting txt= “tell worlds \ out primin (txt to upper caret) ji apie hich gystern Out“ Printaryl xt tolowertaxe)} e output HEtto wort? ngih of Hello works ) z in @ Abi aindi ogee SF iy adhe undex OFC? method ‘return’ the endex( the XYZ post t0% of the first octurrence Of 0 Specified 4” ek tn a fining (including ohitxpace) + ‘i ts ( V gin 7), ‘ Cleqse focate: Where “locate? Ocus Peay anil oitin( tat trex "eoeete?))) 5 v7 y outputs 7 ou J cour epeitions From 2#ro-O 1 the a Bering y Utes BM Scanned with CamScanner ental CRareicters, [ge couse, ShNgS ruck § misunderstand, A \ pimsapenta” conn ee wong cba, niin oe ail sting ° got . 2 teccte where “LOCALE” Orgy ero” “pith 2 “pleas Re ee P wiccunte') 9 % ne tepriatin facrsladexOF cocate")) ann syle oul pie ; a the Solution tp av es \ ° 7 2A String oneate eae a pees” Shins ta gtoorslash eACape. | the + pater Air’ mew ‘strins > “the backstanh(S) '¢ stern (together mnoke,i® 4 z meri aes Cearacees Cn! , qhis » | Calted concatenation’ ‘ exape chavader ex ; : String first nome On Sanat? ; ="Madam" 5 . string Cot Name NX system out: prin tin( fietNome 48 4 Cait ame) 3 Sane sequence \* | don “ef a as’ x" oN public static Void main( eamnges are a: Stig dyke = aring SirstName ="sudha"s { J Sening) Tastdame, = “madam; Suc tem out: Syskna out sprintln (.srstwame omcat (tostNane Ve a Ouch J J we J, Output > sudan Seeing a Aequer Scanned with CamScanner peat CAareicters = str ant Because SEIMGS TURE Be. Lonten, woe, sof “pith misundestand Ais ching Lora ioe 2404 generate om. ant” , gteiing tet = Muse ave “ap year cee Ghudents "fam Siri Vishnu -couie: athe Solution to avoid anv peblem, ia ip ube dhe fioueslah escape. chovader ? Stings hing 5 the Backsionh(S) 'eseare ehaiacter tum Seca fharacers nto String chavatters * guape chavader — “Reautt Desciption « Eom quote u dourie quate > Backslosh : Name) : cmerts & double Quote in “sting f F Le stab Woid mainistogc? amp fi» ¥ “we are \"B Year C8 Sturlen's” from . Shri vishnu, College Syc tem out printers (at ((otst Narre ( ore Ma) av Cee, btudents" from Shri vishnu College pole Way's alright BA ye aye = NTRS alva pA dtihy "4 , backslah In cavatrig Scanned with CamScanner acey ‘ape specie td fan a ee eg re clot an a cout ctat vid maine fering ot rey, = WHello"> mgt Char Atos Gresutl)} My J act Shin char reult = Sysem out pest ouput «oH 2) Re“ Teplacec ) method * he replace ¢) metfiod seaye yond returns a New Shing hes a Mning for a ehavacter cifted. whee ithe Speci tte 4 cRavacer ts) ave *eplated Syntax: public’ String eptace (cfar Seqyrehnchay har mevachs claws “text ay» Public” gatie Fi @ Public satié’ wid mnaingsinng aro) rnin mnystr = Netto Systern’ Duk» priptin ( j Output HeEpo Se 5 | 3) Emp tye) Thin Method checks whether a Bhetng. ta) Arty, Or not ain ed cern) wey es 2 mole ee + Clan Ae Swot + sa ony System sypien i 5 4 e > Shing, apt = seaing 5 tato ts! or requ "pubs, @) Code gon of the 6 Clo Scanned with CamScanner ted poatialasyn satis methed) returns «true. javacter at F cceeg* He) and Falke of np) Binet: Comm. eee Claws - Tat-f Fublic Stake void man( eg on ang JE Strange MY Stl = Mieettol; String myste2 =" eT € System -out> Drinkin (rms is EmptyOr) > Siplern-ou “print (mysera. is emphgy \ yore output? Falke j Tue > sting sting eit method a sont methodits,used fer splittog a Abing seing tated eo cterrg, Boned on the Five, delimiter fas substrings Based % veguigy expres tom ' ec, Unicode. value ‘ eae amet a _returms the. Mn icode, vO Codie paint AS nt the Adpecified endex,'n, 0 Aring E 4 N s sy i ay wVotdematal Csterg Bern dr = Ngtetlo! mute 2 hatellOn; é result: = my de partnecls aug Upm (ple ‘ ,G PP PO + ( IewpU oof \ any, -yrdyo@ +(e) ashts )\ ‘ AYA bid no. Usoe th’ Grtachies)yur le } " hs No his) 2-9 -wioehs BY om erbus Buang Ws sehr bars od Fem ¢ MGs apho Ruus Scanned with CamScanner 26a) Gaur wibuca TOMS A pug i andno |, * { (o)uquud.yno.woishs 6: vba Jag {Chi eon) dndstamauysups 9 e/g buigs ) Ao\\o7 Guroavibus ROUSIN LQS) auusap feisgg AQ) Boss 2 a Lo dus) Ooi PloNDyAG 24 Z ¢ wabwop >qand is ger? vean, b1"s yralao oe ae feniys qorreron anywyd ay IER OP \UZA) Borne eso fe ¢ ‘ UTA ig a i; Mra gush apr aon siih) 4}]UMd 3 aaah “= & y ©, BQpAg, = MONS: Basis ae amas “ae o fe len Juroul pion HPS 4 shops catia Jot Bal nC a aps quirk \ ar quis 24h nue 22e 419 son aporxin 40 474 a gon | craqunt : aie a jos ANE) ahs is areycin Gos 7 |, SEE Dlnh PE ja ave oe ynrono|, 24> . Gia (ain = Pore Scanned with CamScanner 4 3p fens gO Tce usd Bani cS!t2 0M? gauinay! 7a 4, MP" pmax fos! 27h Arr ah * wo uaiawnep ! buy pan acl whuael bury, vexD2\D laewinap puo uric (yunepbuwy h } ¢ Buys) 19E 2A 5 39 8\ua70), buiays 4270242 ns WLS) 19E Leal buiys parjaveds tons preads yin saruraa, buys yp029 Cae boing preiu2aa ° ea vordisaed. 10H Ary? xo. aad Pura bing youd psowsp sxapryvuer¢) 240 ast “wo smunolbous fa shana? 3 awcop 2 MIAOY TM ap Wraas san. 249 satuuan | Luleyon’ + squint PHS Sa Ros st spiked puwop qs / Bu“? Blin cite enemas tone #5 MP HVA eX \usa0,brine. pyn-onv{ 24h 6 ~ TO sol Uy reuoqay, Due Scanned with CamScanner HNO u owe abu aS 5 NAM P iqna of. qiddusn anRaRe 2 (, 1. pays wyAs } anyer bons yiqne s keoep anand Varo sod uy» (6 Mis S( $a hw IMaXOPION VOY IEPA KYO4 PAR UWACLELIOE CaU = 39 LaEIUSA aL Huwys roo cabins) 20M Jus pion Sow “anand aKdwig Wore‘ a\nand wotuor fo WEIUDACY OUR GE ]2, -aeEIGAAL Mab: oy pag 94; wwhps pabo 6 % adhy wunyr 9 4M4 wr, Pou yo wwe 7 poufous ORie{asson ro, yo aU0E sgaunep Ay UO Prog) 040 >4xo U0 Ae MUTI Spoko ware, boinc “4r May usxoy axou. Mr ANH AFUE BS any a) aay. $1 SPY? Uouhiagyed> 1ag5+) Ne oAo[. 3 tod WH) \ 7 vivbq’ Udi Wy pno q awa hu, usage» Bigs fo Sao ames (Journ? 449 Gpumingaa, 72250 CQquabop diowvay 4221099 (wnehny sQuorgaau bias Cquzrene bas Chaser, waned, Hee Scanned with CamScanner lutdaqarurs+,: @ vend, 4 dy \ sys a saejuart OD DU 1LRS ors.9 auumarhy ,))quuney aH) 0 = 46 BCs buys wun pion are 7794 Livery wo)? 9nd = aun vol. gradu irae, var fo- OU JOG Busses nuusin F £ if yndine % 2dPh f CQumape ICWUAGL 20S )unurdand-w ieee A (awaauyatenry-as ) Jue Oriyassang isn nus) n aya us % = aa fon = 49) sever Bung Rove oigay 40 FLA buws Jurmapdy oyo15 95 toe Hak o shUsA Symomoier4. ra)2 .2nard { tnhertance 1 a mechanisro mM which one property oF another Clam “for ex. 0 the bolts Of hiolnes potent forth inheritance » We Cam nreuse the fields end opothes existing’ ofabs THEN > Coheritang claws acquires the child coherits 4 methods facitrtates oRewsoniliey and Gary Emmpstark Coney apAvod class: of APs Puliz S ty an daw, when an’ * rsp" ~releionship | exits, se between b00 Clames we Use anheritance, the 3 tass tS termed soper class and the tnbeigy 5? parent © sub class - the ; u. Keqvoord Wexterndt -napes nr clam to the used by the Sub class to inhent the feahuaot 0 atheve_ axe Var Soper class sheritarve tmportant since vt leady te unk te Srv do veusability of (ode 4 4 a sing Syntax * toneackass dass sub dass,,extends Super Class e TU methods and field, [_pector | cl , Aad cto 7 a Nwey Scanned with CamScanner Pp: Bap Raaeee * void Pottor petals e ’ SY¥EM: ods PON Docker peter ¢ ch one y clam ~for clath. Surgeon. extends "Doctorf En PONents, Vora surgeon -petathog I 15 0.04 Suystro: cuts printla (™sumgton toetails «M5 Cohevitane mpawer class-fosprial Pibhz Stake Vola troin (Shing argh) Surgeon 5 = ved ‘sugeorio’s e wiAts, Spo ctor —petatlse95 5: Surgeon —petatlcy; 2 nk Concepp ‘The 4 : 5 e inheniies y inherttance aypes Of artous 4ypes of inhertiane- dee, are cangle caberitarre: E : ¢ le dnberrante ohe Clogs extends ‘amttnecclass 5mm SING preactass: 00l4) * clam A [eel] yy [ tam B_| om B_| jends OF ly classr Clown A US soper clus claw extends tan @ Ua Aub-clam dad ow PN wxple infertance Scanned with CamScanner tus puattep oer a oe ae te rook vit sopPare 2a + Saver lends Clan A and ciass & Both ee One. sore one, memes, 1.0% gach He GMGIER Vel Enpertiorces: Se Et (ic SOCGn SE Pee th, uttilevel- Fpheritane,, one, class. Con, herik age an the By Hence 1 the, derived claw tomy 2a ave inkerite oe 3 Cogan N 23In ™ from a derived: class clam, for thee! ew. Clams tire pase we LIAR) An Bieurag Metos (a: za clam B exterins ALY a 0 [aan 8] Gn © exterch! BR > te extend ee aonb extends cf [eos C1] clam € exter DY inheritamte claw ¢ subtlay of B and BK © Of Subclay ina claw clan A» bo eye 4) Hreyarchical tnhentane + i rca | Qubciom > In Hrevarerxca! inberctance ) Oe? claws hs inherited, f by VK by many sub classes wv iden ’ in ¥ Clow volt { Clow AA ] : a Son; e \ oC tor es clap] amy ether Caw, Bi cand Ny tnherit the came 2a me clay 0 A v ow BN’o vo » 9.6% oO a Clo cae 2 3 um Scanned with CamScanner (YEA, Boba Mane cy DHgPHa COPerHante, Vs a.combing So , . multiple tbevttances « ate vale vette See Gubrel beter t . Shae cs vy [aon _8 | Scam is faian_p]4— 5 Ail the pubic and prolectedsrmembers pleenic an mye menue of th claw Af 4 number 5 7 paplic public int clon B extends af pubic static void intrement () & numiten bt 5 3 tn -this example, We toherit from’ claw’ A Ach! meam that Btoill alsomeomiain a-field called, oo oe. More, Clamser can. abso be umber smferiiedy Grong the.aame,- Raven’, Clo» ogra claw Ay int O45 Void Shou FO ¢ Matout panei") 10 ai! clans B extends AS: jot ky l , l Nid Bhow kO System . Out Prin ttn ( a Asi oe; ER) 3.0 omg ore i elo test f puric A soeeret B subob soperoo: sogereb suptey is Super gubok a Scanned with CamScanner 1a COMO SL 2 bhocecht sie SyptE UE piinthy (°7 ' a NENTS Hel (rajan))s claw Test p ia public étatic Vo mato (streg A soperph = new AC’, B subob * new BC); @ vid ts 3 opt, sopevob- i =10> “Soper eb j.4 203 system Uk Print ( Ncontents of soperob "3 Superob: showij) > Ach, edd gubob:{= 25 subob*j=35 subob:K= 4) system cut: printin (“contents of cubobi")} Gubob:Showij Od chowk()5 out: print (sum of jak ")5 amt)> 4 ¥ certout? Contents OF Soperb and j: 10 20 Contents of ‘Subob: jand , +23 weraber Acces - or A iweri Fan's adpereab:|=205 3 “ay Pyivete acten in A Scanned with CamScanner | D> pure clans -Hetloworld F Oma ¢ Stati: Notet 1miain) (smeqererg9t spe hom = eu) eemeight UNV 84 Be 3 pub eoxweght ™Y Boxwaynt myer” double viz mnyboxt sours ()5 So sysern-out preneen(" yauurne of pst "Si ve mmybox 2: volumes aystern cue pinky J caw BOXE double width) BOKOS widtn 2-15 Reignt *-'> depth = height cept 5 Box (ink ten) £ width = Reight depth =len5 4 J a Box ¢ dowble wo double double 1} width =" fe nt . ce pth r 5 J ‘ clouble Volume( f xeturn width * Ruight * depth y G J Poedeigrt (20/350/93) 085 “vou wae (“volume a mgese mals utpuc: Nolwme of mt _ Olu? OF TF Wer" an Mose of TAN. & > SORT cnntante Varta’ = Super On & an be rnexhod superO) Can clos Corer Prope sn? public Clow Pulblic S ; ( Scanned with CamScanner r qos POXWeIN extends Bont Pim — doubie weight 5 sane Bowwer j ae 019,34:5)- 1AM (double Wosdaibte ts doubte dj Maudie Mt e18B0iS2¢5\, weigh Sa ’ ‘ . e er wy En neds rvs SNe 2 a weight =m} Ds, ay) 5 output: Volume of my fox! %& [4oo-0 — Volume of Mybox ’W 2640000 Aue \ : > ; "yor? of TAVA SOfer Keyaog goper @O Be Wed tp refer Immediate ‘parent claw yo gratance Variable can Ge Used to invore tmmediate parent clam 2 Super method 7 eyperC) Can be wed to invoke ernmediate Paver super Oe claw coraructot hogar? “V al, Tect Super public Claw f : nGT ypiq reain( ering ares orbli Void maine % are Nf a) Scanned with CamScanner P ai ox fed OF Parent and crilA Alans % Peto fe po com Arima spacrn-outepreate( “ne value of 1 t!+195 axing color y lows dey ee Seing color Noid print nt by into) F Sypster syRte end AS class B extend rat F BlIct a7" 9 - — a oO oD OD o OG 290 0 O28, HO Sn On0 n~ 0! Scanned with CamScanner Be UE OF ing gute pr att © Met lo refer: tmmedide, parent clam evlane T gsabl® a Nips CaP Ue Soper Kerndord “to ateah We data Weber Ty Geld OF Pent clay. Gs Used Parentelalh gad child Clow Rave same. -y art Tor oer ide lie cl e qublucsiattc void moinl sein are DY Figure f= Neo Fgurecs:9)} R a age v= New. Rectan te (4399 ectang ig a new Trianalecey Trang! one 4 is 3-0, pla(s Area ih.rt aefooxca)) S-o- pin C" frea wit tt aveats)? s0-pln (Y aceon ur + axeaty)s nem F \ BI Aulotlan* output 4a oncfaure in Scanned with CamScanner 3s eS Dad 1 fF r DIFF | Pool LeiPaia yea mon: ew ae ’ > the nal Re id meshed, Which Treice, for classes » aterbu! an Ow : smpossible to Theri | der ro charge able ¢ mnpe . q oi wig $enal - > the final Keyword 1G useful hen You Want g re cham voriable to atumys store the same Value , like py 9 Public mee ae 2, § 2 c D) A Unotic clas: 58 Test 4 4 final cnt x70}, BR ey Public static Void main (string argc dS com = a fest ob = new Test()) Ob- x5 67, ua Spiers out priotin(ob os 4 4 4 a output : ewer’ cannot Qigh” 4 Vals 45 final’ variable obxaty) SA! Ae q ’ eo final o> prevent overriding y i) Public claw ap output em Final Os Void meth()F pend’ ci System: Oubori ntty| Fo F Steen Out printin| ‘parent class final Deed) 5 oF we Public Static i Tae Void main/ sting angca)f, tine Bob - , 805 G& Corny ©b meth) ee Sopercla dom g extends A S Scanned with CamScanner : eee a Ps ee CANNOT Ovewide fing ne defer Unes y oe te metho) 1B connet Overide melt) (nA: SOM Ovens do prevent wheiene pm 1 a Staal 40 Pr claw Test f wi ta ute eur state Noid matn( Sheng. orgeCDL Uke pi Bob= new BO} Ob-methO) 5 ind ¢ N r hey and with 9 output s Natjaury enor: A ts abetrac’) Carmo! Ge tnvionttéled ih Bie neiAC; 7 lervor we shoul “ge ; , a> publ puble Class Test? ; tnleiefar Publé stake void main(gring aigeca) $ a toon B b =new BC); b-tattmee zy Inte D-cattmed) 5 6 caller ee on poy Sete: atin Blemautbantin( Concrete y Void Callme() ¢ 4 Child Clam tmplemant Scanned with CamScanner fy } output * Chia das tmplementation Concecele mets! ip 0 callene method tn Bt S ors Bw» not abshact and do not override akeskrark netned caltmet) wn A claw ® GHends AE Hethod) 5 eo) pe obser method declowed a woh Remiéetor. att ‘Istract nethaac)) and clowd broces gn with no ORM nen And (HCFA I POGTAMs nsiartiated| i there 0 aweyal, Cla we should Rove only 4 clam, Cory, Interface deClaved we make ery we are raising public os, name of file wo public, enlei-face Cor Ly 4 don't t eb only abstract every clams Cet) inerface od qublic 4 make here NO methods methods of catertace » Ub 0. protokats p Bring o wh Teatpeshoct i he Vola Warn Sng arqst J) { L q ingle r= new ¥ clang le(4. 3) q (eOo nal New retargle (619) 9 ~ " \\t r sey ratte UAyen tS + Y.aTeaI> 4 templemari, Scanned with CamScanner 4 adaract claw gue dour dimi® doute dim 4 ( , Trterfors oF Figure (doube, a,Aouble +) { i foun ‘ mut tock fay dere L242 ; ra qvstroct 4 snreot prerect buble ox¢a()). keOee : enterface © extend Fpuret cnetineds det clas» Peclangle only mnethe fpectorgté (doubtea bu Bure F(a¥Y3 exfateh but Prt id rece 1 Aver astm ywaimd5 Scanned with CamScanner

You might also like