You are on page 1of 22
DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Tanw cdeni— | > Sometime we can oleclare a claws inside onotiy class such type ef cletaes ane cled Enver clertes, > Tonet closes contagt Intaoctuced in wi vesion be fix gor Bugs 7s He pou a Evert Han Ali, > But becor oy powrtdal fedires ancl bempite o Trner clorses Stouly programmers one Started uting in vegular Coding ale. so Withent Crishing one type of objet if tan fer no chonee of trtsting anctter byte of objet” thin we thet go fot Tnnet. clatter. (| EQ? Universilf consists of sevtel diparbmenti, softbont tasting Universi trae fe no chomce of enitting Depostinent. ( Alene Depattment is the path” op OniversilG omel we have- rte declare Depattimnet clo tratele Universilfy class. cy clas Oniversilif ——~» Outer clay a Departmen — > Lnmes claws x 4 Ex@: withonk enictieg Eank adject Htc fe ne chanes of enicting Aceount obfect. } Henee ne have te declare Accouct oles Insite Fanta clan, clon Bank a is chess Account | 1 ie ———— — PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 EXO! Map & a Callection ef Rey-vale paiss amd each bay | volue paix, & Glee) 29 Endey. Hones Map fe Coneteleree| a4 4 Collection of Ening objets, ! Witient emttivg Map objet tote fs Chomee 4 7 Mep Chject: Hente Intupace Entry ie clefinesp tneile Mag tbupaco tebe Map 5 Outer trices tot | Duss ‘ éobey] 102 | Rewt fatten EI, aon othe 103 | Chive | \ | | | | aaa »? mag < ete Os— boMthont: enteting Out, clas objet Hi te ne chamer of | 7 Tonew class Object. @ The relationship Mio Ontir class ¢ Tnnee de ia nek patent te child Adstionchip. Bt tc HounA Aelabion thie (Composition / > Basel on patpowe § position op cleclaratien Alt dana classes | one chiviclel Pato a lifpu. A. Nermel (ot) Regular Tones tletes [ 2 Mettked Lowel Dane cles 3 Aronyenons Done classes Static Nester) clans oo dy Sewmal Gy Renin, Taner geese 7 ie" > Ty we ae clectaring any named class ctivectty » softheuk ohitie ModifitA Such tegpe oh Tome classy fs calles Normet GA) Pegulah Boner claws. ——— PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 . 2 DURGA SOFTWARE SOLUTIONS ‘SCJP MATERIAL a jova oO, sjovea. oO) E20: pees OW x estes, Ontiriclers Onttr$Tonet.. clay | re ¥ Jove Onterel : Newne) (A) Requdak REt NoluchMethed Eretz main Dome loag fe Ont fIonered TRE tNoGichMethad Gat ¢ main Re deve Onty. java L Ondtir.clory Ot dToned. dey a Pe vme) fovea Ooty el YJ 4 CLP: Ontit chars Main method S.op Coutir class rain metho"); java Ontir$ Toon el + y RE NefuchMettod Erk: main J ae Tomer clots we carit cleclave stable member. Hamer ne. gy Cant declare main) methed $ ne cask jnveke Toner clas SL pgtitedly from commnansl prompt: 25 ap ne ave tryig TH leclare shai members Foals ianee OF Clatses Hy we will get Compile ime erreb. ‘ ches Onlin Bees eee < gv main (Shines ory) cc is Sop C'doner chery main rnethod') 5 Cet Donnrcloues cannot have ctotic declatctton IRSHA CHAMBERS, SAI NAGAR,NEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE-SS0S905700 3 DURGA SOFTWARE SOLUTIONS: SCIP MATERIAL Prcceusing Toner clos cede deem shi ates of Out eta a ex chat Onke class Trmet { prblic void m0) Seoup Cf Bemer clars method); ay 4 ps vy me) | Re Outi oonew Ota; Oud. Lome t= i Oct Taner te onew Tonerl); | Med Ontirc).new Eonetc);| | ferndcys =) Oh Toner clagy method | ey, new) Octrd). new Tomer ems) Accessing Tnnex clears cocle- from inttomes ata of Ovtey, clan s— chars OW L cars Inner L pull void mic) t S.o-p C'tnner claws method"); le sy public vord mma.) o Dom fenew Innnt): may sv omc) aoe lp: Toner claws method Ont O=new Ot) °. ; py mens , LOT NOG HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES MADHAPUI-S0O034, MOBILESS0SS03706, 4 EE DURGA sorTware soumions Scop MATERIAL caseittys Aepeusteg Toor av Coole trem owkide of nites clay? — Sar class Ont L ae Ton pabtic veto mic) So. pU'tane clay meted 4 chews Tet : etd ps vy me) olp 2 Ennck class : [ a Ontir cone Orta; OMA. Ean feo.nes Poneac)s h macs 4} Acearsing Fnner Aess code From stabi. area of Orter hors wy From outside of Ont clas Frere trtkomen ent fe Orta chy Ermer ened Inner); i mtu); Ont, cone Ort; Od. Err fone Emre; itor; PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 5 DURGA SOFTWARE SOLUTIONS. SCIP MATERIAL ' — From Notmal (0b) Rgwlar Inner. clay, ne can aceny bol stabi 4 ! Rena shettic members of Otte eters ctiazztly. ) Ex Clay Onley | ~ cE nt A105 | Shadi qorss ‘ pub vote mic) £ S.o-pla); => ep tte yeep CDs > oe te 3 Ps vo mC) ' ee Ont conned OutrUy Outi. Bane feonew Tonary; imac 4d % y > Witkin “the Eamey chars tha alongs refers current” Ermer claus objed Bid te Acker Current Outer class objet we hone be ue OukE chard nowt e this Qt day Onte L ne aa pos vo mt) Clerws Loner L yew OvAU.new Dmatt dmc; Tak actors y : nia void mA); > ! || & int a 100d y Sop car; => olf rive on) ee { — S.o.p (Loner sth.) 5 es sop ; |, Lys 2 PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUI 6 10034, MOBILE:9508905786 4 DURGA SOFTWARE SOLUTIONS sopwaream | pf PTH. only appiicade mostifiens For Lop level charses (Cuter classes) + wrt public, edibanlt >, final, obshract 4 ctaietty | Bet fh Tener clases opplicalle modibieer one preivale protecte} Static Axe Sh tess | y We cam cleclare Bnnrelon inside nner claw Te. newbing of Drmer claties 4 possilie. pablic void mal yes & clos B d fi clos C ( Je | | A i | Sop( Taner mptk elas methsel")s | : }0 es vy me) L A acne AC); AB beanens RO; ABC cebenew CU3_ a Tweyenew COTE conse on Hes SOP Olp: Tnner most claw metkoe} —— PLOT NO.56 HARSHA CHAMBERS, SAI NAGARNEAR BIGC MOBILES, MADHAPUR-S00034, MOBILE: Fa DURGA SOFTWARE SOLUTIONS SCIP MATERIAL 2x Method Lecot Loner Clay -— —> Lomebimes we Can cleclase a clas inside Oh Benn choses one cole Methoel | 2 Th main purpote Of Metkad Le ‘toner clacies to fe efine method Specific, Aepeatidly vequided % ality. > Mettiod Local Fant Closes. inneg chatted ove beat > We ean acess Metod Local firmer clantes fa vohich we cleclared Luka tr hort neked fntide the method it heey from enbide The mettad we cant Acces, > Hente MetKed fecal tne clanes one most panel ued type derer dau Cheeew thi scope te vorg lus). ext clan Cuba public void sumCint a, io 4) = Soe (ary); ¢ 4 y 3 Epn jenew Prt; ¥- curnCie,20); =) olp + £0 Fs Stir (io, xen); => Ole 1 300 j y ¥. stam (orm, 2000); =} Ol” t SoD Ps vy mt) L Test tone Testt); b.maty; 4 } 7 PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:950S905786 & A mete euch type | DURGA SOFTWARE SOLUTIONS. ‘SCIP MATERIAL [77 Ne con Aeclawe Tomet chats Trufcte botk Instance 4 stabic melt ds. J Bp we declare trifle frttamee, method thy we can aces belt a Shit § ren—thshle memboas of Cacta chaes Uitecthy ? Eb we declare fntide Stetis meted thy ve. com cers only Static members of Cnty claws from thal’ Method Vocal Tnmeg chars, ear Clary Teal —~ Prt aAat03 . Shdtic Tot yore; . pbc vord mac) £ = fies —> Ef we cleclave mit) method a1 stabi try of Liw® ve wlll Get Compile time erect Souging. non - steche ve erebeene erm a sfeitths_condeak: eee es ee Vatialdes of 4) le 2L_connet- the metked fn which ne declare! thet Toner clay, |S kab ty thet local variate declared a4 tin We Can aceery, | “HLOTNOSe HARSHA GHANEERS Sa NAGARNEANETCC NOHTEE NAOTSTOR GUOOT NOSEEESSUOE 3505005706 4 DURGA SOFTWARE SOLUTIONS ‘SCJP MATERIAL, ee chy Tel Temreys Tad 12105 public void ms Ib sa yore | clay Eon \t ) puldic voted mit) hla ee | S-oplayy Gaz Woo) vosiols. yt aenceseel trom | y ry “fitter tata; nents to be | |3 dectared find Enmerfened Znnr05 ps v mR) Tere tenen Taber; Shee 3 ~ > Ep ne cleclareat ys del thy we Wek gel any ce. Q! Consider thy following cede. clas Texte At Lin® which of te dollowtg tL Petes Valiale we con aceend? Stele tab j>205 yi poWlic void mac ay J_- ok teea0; yk Firat | nb b= gos tue fia Tone © pute void m2 Ble Live® PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 10 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Qt th we declare ms Him ot Lin ® which Voriakly we Can acai! Dix aire gk x yh Qi Up we clecleve mat) metiiod a4 tiie Hen of Line@ Wwhicly Various we con acces? AMI We vill get ce beeox Bang claryes Cant have Sometimes ne can decle taney clay witout name such bape | 4] toner clases ane calles) Anongmens Lone Clawes. {> The main Pespore of Arony mous Innes closes te jut fo tutte use C4 time atage), | Tee ore 3 tapes of Anenyment Ener clanies. A. Among eens Toner class thab eatencdls a class 2 Among meus Zone clais thal Implement an inter fore S Amon mous Domea class that defined inside atgumenta, cf RLomrymes Eonek clas thet satends a clay 2 Sez a RegCotn y publ votd taster) {Soap lsat i lod mcle methety PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S0003% MOBILE-SS05005766 0 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL i claws Test j Ps vo me) RopCotn paoew PopCotnc) Public void taster) fe ic » op C'spicy "Ds feat 4% Ps take LI; = 0lp7 Spicy PopCoin Ronen PopCainl); Re bastecys oy olp: Salty RopCoro , = new fopCoint) i peble. veid baste? L Is op (Seat): u fh. tatkeLy,= olp + Soeur 4. fopCetn p anew FopCotnc); —? We one eee Jost RopCotn. aject. 2. PopCotn pene fopCotnc > mous Loner Clots). FA tek chil claw ne oe creaking on objet cotlts parent Acfevence. ed PLOT NO.S6, HARSHA CHAMBERS, SAl NAGAR.NEARBIG C MOBILES, MADHAPUR-500034, MOBILE:950590S786 Ie | { j & > he are, erecting chal claws fol PopCein wi thenk name (rong DURGA SOFTWARE SOLUTIONS SCIP MATERIAL , 3. FopCotn px new fopCotnc)y pekle void tac) ef S. 0. p C* Cpieg )s oe a We oe Creating chitd class fot RopCotr witKiowk rome (Ane- mp Inn Clow). t—> Bn child clas, we ore owstiaing tater) methsd fot thal } chided clas ne ate Ca an objet Wits pavet reference, | ext clay Tett- t Pe v mC) } Thread tanew Threooll) + t . A rete; tH) Y aor Cichitel Thread Y; ( x / te thastO); fot Cink Fete, Tet) ce J I]S.0p (* main Thaenels ay > Be ceria eae eta eperens) eae fen ctey Tat L Pov me) _ I “HOFWOsn HARTA CHAMBERS, SR NACARNEAR NC CHOUTES MADHAPUR SOOO MOMTESSUSOSTE 13 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Rumeale t=nev Runnalle() : public vord Aunt) Lbs cnt fo; fe10; tr) Ns. eapCrencty Thread’); ey 'y 3 Thiead benew Theaclt)5 £. steant©)5 derCidt feo, Teto; i++) t S.0.pC* main Threael")5 x 3 oe 3 Arengmons Loner class Pek _cefior Ensick orga} a clay Text ps ov me) nev “Theead (new Rennobel ) ee void sunt) each 5 fe to; Tt) 2 op Cichitd Three!) si J ¥). stest5 ArCit- imo, te; i++) e 0. p Umer Thread); PLOT NO.SG, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE 9505905706 ly . DURGA SOFTWARE SOLUTIONS SCIP MATERIAL | Provgmens Tones Drnet Claas ve Nobwal clarg i— I> A Normal Tova clas cam ertenot only ent clan ata time , bul A] Anonymous Pons clas alio Can extuncl only ont clay ot a bine. CO] APNemeal Tava clas con tmpkment —- interferes ot a time, bok Aronymoms Tone clas car Pmploent cay om fetirpace ak ( a hime. 1 A Mermel Tava clans com extend @ claus and tan eae), ne. g fntubeces simubtaneoutly, bak Anenymous Tonex chats con Ogg portend a claw 4 Fregolonns exct- an tetrpoce Sfoutlome eval. don main kcobion atea of Anongmens Lone clattes fe & fapboet QUE bated applications fot Crort Henebing, | C2@t impak jova. ade. ¢ Impott java. asd ewents 2: 4 prttic clasg TasDeme zt | Po& vo mee) oJ Frome fonew Fromety; a draddWinderskistener (new Windenacaptc) polhic void wind Closing C Windonsevent e) system. eait Co); »; Aracld (ned Lab (8D con creati Ercotabe Jor File!!!")); | G:skSizne (se, 500); FsavisibeCerey: | a PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 1s DURGA SOFTWARE SOLUTIONS SCJP MATERIAL EO: clay SomeQuE etends TFrame TBatton bt, br, b3, ba, LE be; bd add ActionListenes (new ActionListar( ) ae void action Feshorredd (Actinévert e) fy papenn ow Ayuised opuction iu > "bh, adel ActionListent (new Action Listenet( ) £ a auce void actionPepormed (Action Event €) [tlre on agquitad opaction } w ! 3 4+ Static Mested chartes 2— pene eee eee Tomer class wits steitie modibien Sue type op Tnner clories ave called Stebi Neted lesa. > En Notmal GL) Regular Eon cles, woftrovt caitsting Cntr ches Oljed- thine te no chance Of ealsting Lema lay djete > But dn cam of Chobic Nested elares, wilkoul~ en ting Ose clans oljut thre may be a chance of eritting’ spate weited clay objet Tree, Nested chasy oljeel fe net strongly avetiate! witk Odin Aors objects ef clay Tat a2 Static claw Nested a PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 %6 : DURGA SOFTWARE SOLUTIONS SCIP MATERIAL A polite void m4t) Scop C* Gtabie Nested clas metkad J; 4 y Ps vo me) I Tet: Wetted nonew Text. Nested i); (cntetde of, te clan) Nested nenew Nested); Memto); tf {> Fe Nomad ob Regula Loner dane, we cont take static clecla- creations wet in Static Nested clay we an take stati oecha~ sections Frolucting main(—) methad alte. Dttenee We can fnvoke static Netted clay olitectly from command prompt: (SE clas Treat jevac Teck java ‘ L Static chars Nested ( Ae op) Tee Clay Teak $n ented od oclagy S.o-pl\ Statice Nested) clayametkod'); java. Teet-el « 3X 2lp: Outer. claws main O 3 method Ps vm : Java Tek} Necteol el i So. p C Onde i "5 t p Cont, clas main meted”); OW: hate Nested clay c main method 3 A {> From Notmel (ct) Regutar Tomer clan, we Can ecey bette tobe 4 nen — static member of Ont clan Aitestty. | > Batm from Static Neteal cle, we can aceoy ony tht membexe PLOT NO.56, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9S0S905766 4 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL i Of Cutan chars ditentty. ex: clay Tete £ Snb 2H 105 stoic fd y= 20; stabic clay Nestect © bic vetd mil) t S.opla)y—> Cet non stable variate x cannot be yer as aeferented from a ctabie content. ge pees Bibfereres eo Norma Foner Uae § Sbebic, Nested Clove 5 | Normal Loner claws : Gtabie Nested Clary | = | 4. Withew isting Ont. chlor objet A. Wetteut entsting Outin ne ctau. fe no chante of enteting Toner [Hae may be a chante A enti —r——— ST — == oak ies, Shahi fs chrongly associate vf Cutie clay| Nested clay object a4 not— strongly abject CComporition), aioe it Ortie dais objet CAggrtgation). RTn Noted CL Regal Bemet clanes,|2. do Stable Netted clanes, ne Can static dectarction are rot alowed. | declare ttabic memberr. 3, Bq Newel dont cau, ne codt — | 8. Tn Stas Neited clayes, we can cleclare main(-) method 4 hinea ne [declare steti& members $ hence we edb Tnveke Tnne clay ctivety can Invoke Stable Nerted lars from Commonrel prompt. Aire ctly ¢rom cmcl prompt, 4 From Morrnal Dnner clas, we can 4, Fram Stabe Nested Cleves, nee bok stable 4 nen- tabic we can acces only clebe membecs ft membent Of Ontir Clay olive dy. Of Outer chars clitently. PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 en 7 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL oy Vertes Petathle Combinations of. ees amd febbirpoees ¢— | 4, ela itide @ clay 2— |S onkek enti one begpe of object Uf thee fe no chance % eatsting awrother type Of object thy ne can declare 4 cla insite onetter class, t clay Oniversitey cb Chats Department {, 3 3 > Wi'ticouk enisting Oniversity objet Min ic no Chante of caching Department objec: —P Henee ne heve to clefine Oepattment clay trutde Oniversitiy class, i 2. into fnatde a clay 2 J Bstole a clan, if we requite muttiph implementation of an frterpace $ thee Implemertations are Adlavank 15 a partidar clay thin we can define an tatithae fnifcle a clay, Eta Viele ype c Tateiface Veehiole e pallic fuk getNroOfWhely 5 Jy clas Bus Tmplomentt Vehicle © public Pak guNeOfLtheels¢) vetivn 6 ; . bins Aude tmplenenlf Veekiele Lu pebtic Pale Of Whale U) Se getNe PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE.9505905766 9 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL L 3. tntesppace frside Titeypate + ee ee e4, o——— —r—— ex Sapo Map i ; ee Cache Paley | ' ire om CE peblic Objet athe; buy Value poli. Ajeet getVolurl J; . public Object cetValue (objeto); iy "Sep fone fates te alongs sh. Hone ne Con Implement Inna Prtetpoce directly witout Inplamserting Owtin interface. > themes we are implemrenbivig Casta Pilepese We one not requited “to fmplenet Dnnet. tterpage Tees, Clete 4 Tomer Trtefeces we Can Priplement tock penchinily. Ss interpece Onl pull void mil ys Trterfoce Tnner SS tts void mat), ¥ clad Test Prrplmrelh Cuter. Prone tL pubic void mot) 5 S-0-pC demas falifece method"); clay Tate Tmplmentg Outer © pasttce veid m4 0) Sep Ct cate, interface mettodl") 5 ‘PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 20 7 DURGA SOFTWARE SOLUTIONS SCJP MATERIAL i dia intide_ fatness 7 |— zp a cho cfenchtonality is clotely atoctotecd WIKI the Ute of intaface tho fe lc Righty aet.ommencled te declare thak clay Trutde frcbupaees | ee intafece mall eavice- 1 4 ke void condMail (CmailDetatls e); { clas EmailDetatly LL ¢ private Stating te Lists 7 privet. Stat cubes Ol > @n ae above. cramp, EmatlDetoily Patty fe veguited dot SrnailSasite g we ont mot stage ong thee clic. PF Heme te te Atghly Aecommended to checlave EmoilDetails clay Trstde Ematiservia fterprer. > We can alto cleclare a clay Tniide frtupese de provide de font | tenplumentetten fet thal tateufase, ar fxtupau Veehicl Tk ae tae gb Nop hela as Clas DefouttVechicle Tonplomrenlt Vekicle \ © ux Pak getNoOt Wheels) 4 dam 23 : ~ clr Buy, Tmplmrentt velicle % pute Tak gethboflhtels( ) L weliivn 45 mr TLOT HOSS HARSHA CHANDERS SAT NAGARNEAR BIG MOBILES MADHAPUR-S00034, NODILE:9S05905706 2) DURGA SOFTWARE SOLUTIONS SCIP MATERIAL 1 clay ‘Test~ | tee vy mt) | £ Veehiole. DefattVechicle donew Veehicle, Default Vichicle O)3 S.orp (A. getNoOfWhreye)); SOP 2 Bus benew Ruse); 8.0 p(B. get roof Wheel OQ); polpre ae > Fo the above examplr, DepaublVechicle fe tke ole pant” Tenplemendation A Vehicle rcterfyereo, whee 4 Buy te customized fmplomertalion cs Veekicle fxtitpace. Rote: ~ Every claw vohich te dleslared insidle trberpoee iy alas -_ ce stoic. Whthe ne aw teeming A not: poblic stetic, Hence ne Con Crecti objet clivectly aitkond” Implensosting ideafase 4 wirtkouk Creating an inittomse Of interfree by pes j Conctusiogs S— > We can cleclore ing Pntide ong tiing clay X clan Xx pe x co x Say y : eae y clay ¥ ihebewe L | 5 2 pee | eer : om > Nate fnterpaus ore bway chatic bub Nested clay need not be stabi alia, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 aR

You might also like