You are on page 1of 52
de Declarations ancl econ Mecibienr DURGA SOFTWARE SOLUTIONS SCIP MATERIAL, 4, Tava Source Fil, Aructire 1 2. class meclitiens | 3. member moctifiert a tetesfrarees 4. Tova Souvee File Stauctare i ee EE 2 A Tawa. proqrom can contain | neo classes, bud otrnost. one clon can be deckavel o public. pf Bh te fe a pathic clay thn nomerep the program § nome. oy ' the puliic. claws mutt be medtehed, oftarwite we will get £6. co] ty Hate po publi clad tn we can ue omy name fot Tave prey amd th ave no testaiction, rr ———“ ‘isl do& Java progrom. O} ea: Ajeve Cami? tf clan Bt public then wore oe He peg Ae Bajo, OF oe wit, Lae se ce ory | la & ie public cI ce Gi: Of bot Band ¢ clanes declared ad «pathic By name of 2] programs te Gafave then ae 91 pk C6. saying, doy @ fe public, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 L DURGA SOFTWARE SOLUTIONS SCJP MATERIAL, F i ' At / t : io); | Dele | y | Biclay Codon, Luu 6 | ja ad jova 6d fe mt O1p: A dew mais 4p: & clas rmrain t \ acl lae cae Rigen) “ : ‘ ja . Olp: € class main 1 yt jeve Od 7 oh Svot t mai Soplte maint); | REt Nefuch Method € main I | oe aren E 3 i Ret NeClass Dap Found Errat : Distge. 1 Conclusions. !— — ce We ton Compl. a Jawa progam, bub we can wun Tava elas B. Whenever WE are compiling a Tava program fol every clay ome vag File wit be crectad. : 3. Whneve® We are cnecibig @ Tawa ches thet cormipencdting lars main(-) metKod wll) be erccuttid. Ge Dp the daw deat coroin rrain() meted The we wil ger Re aujing, NoSveh Method Erect : main. 5. Whenever ne are eacciting a Tove che if the conves penclivg ached fi Bo vok evailalle “tay ne wi) ged RE saging , No Class Def Foune) Ero 6. It tc heghy recommended to take only one clas dot source fite- $ rome ef the preqram avd mame ey the clos must be matched, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 a The advondag. Of this approach fc 4 malintainabibly ! wit Le fenprovedle i impott chatément= 2— Sar chars Teal t { { ec v me) Sgrbel 2 class Avraylict- 3 lection; cles Test t x ; frengbice tenn Array hit) ——9/ GE 1 coorat final cyrbel P be can recolt thi protien by tieg Gevenwtil AL Le ned java.util ALO; Fully qualified name . OTM preteen oils weage of fully quatitied nome every time is it Treveaus Length oy the cole 4 vectutes renclabitity, ee ee ies vatng Tmpotk ctabeenent ey Tmpott java.util. AL; chy Teak i rs v mt) AL benes ALL: y) Gear me FD Wheneveh We ore wing fonport- Ctabimjent” ne ov7e , wae folly quotipied rome f ne Can uit chet names disectly | Hence imps stalmenl- aul ay Beat_typing Shobak: PEED: Tyee of fropert theteeenls (| There ave 2 tyres Op Pmpak stetiventz, f 4. Enplicit clay tmpotl a 2. Tanplieit led igor. A Engiicit clay Imports — Ent import jova uti). als ob ryuiresl is PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR,NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 | 2 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL up te dighly wecommended “to use enplicit ctor impost beer ft > Bet cuitalle fol Hitech city nohere Acodabi ily ic Tmpettant: 2 Implicit clow 7 ae Ext finponk java utiletes pec > Bp te rok tecommonded “to user import becox Te reduces veadeti- | ily oy tke code. > Best cuitolle dot Amespet whew egring fo Tmpottont: See hehe a tha following Empott” thebimente ame meenigdel Le Frnpott jowautil. 5 ¢ K® tmpott java. abil. Ava; K®@© teapot jova. utils : G6 Import java. uctil. ALS ER: Consider ee foley ded ee Ear clay Mychjet ertenct) java. amt Unicast RemobtiOb ject ey > The code compily fine eventhos we ane nek Uti Tmpost Shbenent beeen we used fully queliied nome Notes— Whenever wie ae wing faulty quokified rome fe fe not Auwirec waite Import ctabiment: ty voherened We are walking Tmpart Stotimgend tRiy fe fe net weguised “te ure fully quelified rome od ne Can wie Shonte noumes cUinertty. Conwy)? At Kempe fovea. SU; Tempo: Jovas sgh} cles Tet 4 es v me) PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE,9505905786 L & See DURGA SOFTWARE SOLUTIONS SCIP MATERIAL : ee Date. chomew Datecy; —9(GEi efevente to Date te ie aebigcond) | y ——________. wee will geb carne ernbiguilg preldwn even in cau op List CC ———CE peckages. thw whit, etolving cleo names compile wit alongs give “The precedence tn the following Jade. A, Gaplicie claws Tnpott 2. Classes present Tri Current ead Bicccdomy (C0). 3. Timplicit chars fmpotts Sei Impett fovea. atl. pets UT Impede java sgh res clays Teak t psy me) t Oeke A=new Detic)s ; y% | THe cade compily fine ond atti! pacleoye Dati will be Corutcleredt, Coretuy: (| > Whenever we ere. Eenpotting = pecleege: eU claues 4 fterbeus proest th tal package me availaiie, bur nol Lubepeckage classes, Ol sence te wie seb package cla cempuliny we cheutd warts fenpert- cttemenrt- util cob pocknge fourok , We ust Patlem chart in ewr program which Import Shattnent- we heve te uses LO impart 5 eva. a; fe impet jeva. cil PLOT NOS6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 impo java. wbtl. regen. %; fmpct fe iteol we GQ vo tmp wud > The following 2 packages ave wk vequitest te Immpott beeon, 1 mU chawes 4 Trctespotes prosecté fo Theme pastcoges one by difoatt'y owailalle Tg ewory Tava program. @ jeveteng package @ cefantk paekoge CCunrent Wotte tv Directory) SCIP MATERIAL, 1 vid: > Import Statinenté fe bokatly compi. “time. feewe 4 thee no eppect on eaecation Lime. | Hence mote no. of Tmpate preset thy mole will be ther Lerpila. time. wa and Jove Com 20: Dibfrvome Bie ¢ bergusse dbbebade ood Devs | ogee fogrk teak « \ 1 I ' 1 \ 1 | j i | trctuslec stetio. A> impor oe 4. Tey they coe, abl Speedfied Tae Specified “Brag chides woos SHily voty be tyebucted at te time |be thelucded Eatoeuced th 1S version. > Preckding BS SUN people stabi Import improves ceaclebibty 4 weeny “the code > Aechling “be WeAtd wide programming enperlr (ike us) Wage Op Static tmpost seduces AcoolsLitlT omol creotiy Conbusion. 9 tHente if thee fe no cpeeibe rquidement they TE fe not retemm- ended “be wie Shabic trmpost. | Paertty We can acters stabie members by tiny chars name, bate whiney We ane writing statfe fmpott” Thin we ane nok crquised “te we clan names amd me com aceets stable member Aisedly eax Without static impel LULU ee Inmpotk chabie java. tery, Mathiog tt; L impak stecbic Jove. tows. Mathes ys vo mC) las Tut S.o-p (Math. eg. st C4); L, sv me) 0 i A . PC Math, Aomelerncy)) S.0-p (har (ay)y y op Cmath. man (19,20) Si0-p (andorgts): PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:950S905786 7 S.o-pOmar (10, 20))5 RR > ee eee Ans che Teat L Stebic Maing nomic java’s J a —> As out f¢ a Stable vosiobe proect th Sgeken chaes , whenever ed stetic. Tmpest ne Con acc cub diterty OT out Err import stabic Jove. hang. Sytem. oly clos Test ae Touts patabhr beter), ouk, pada (Mi); ay EAD tpt static java. tang, Cyto; TmpaAt static jena. Lome » Sontag «ky Clay Test L rs iv me) — Sooe p (MAX VALUE); —> (Et mherence te MAX VALLE y? crtiquey L gs i DURGA SOFTWARE SOLUTIONS ‘SCJP MATERIAL PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL ex®: impett chet jd Byte. Max_vaLve; —>® fenpot ckatic jel Tata ks cles Teak t static fat MAXVALUE = 999; —2 © Ps vo mt) t S.o-p (MAX_VALUE); = olp 7.499 y : > WL deselvirg, Static members compile will aboage give Priademce tg the Fotlonig otder. 4. Cuvvedt Clais shade membes 2. Eaplicct static Tmpott 3. Emplitt stebie Twpett ap ne Comment Line@® thy Eaplicit stebe Tmpott” considered ond the fp fe 42t, hich Uy Byte claw MAXVALUE. win be 9 Hh we comment thas DLO thi Antega claus Max_varver woFll Corsidered, which fo >. et aqaeecat, Neral fen, Nerenal fmmpett sepstor he Tempest package eee Teapot nowt eee ee impale GaEE peakagprame.. clarinanne. stakic member, iangett static gece oman. chev rawe-e Qi whi op The Fotiowing Impook eres ove velid? KO temper joven tongs @® impart Jove. tangy Moles KO pot jaw. Lowa. Mati Sp.at, PLOT NOG HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500038, MOBILE'9505905786 4 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL ' @ imptk jevartang. obs HX impott eu ngs Mates; XO® tm Jena. lang. Mattie gabe ; KO fmport shebie Java torgs ; HK @ tmpott stable fovea. tong. Math ; KG tnpett static java. Lang mebh. pds KO frp stabi Java. dong, Mate 2qsh lI : EG inpotk static java. lamg. Mather; | KG tmpotk static java. Math sg ahs ¥ 5 I X@ impovt sbabic. joe Romy Maths 1 | Note: “Teo pactonges contaln a clas o& Feder pace volte He Kamae | nome fe Leare anol honce aonhiguity prem fe ale vere 1 fan in neterol tmpott: But 2 clauses contain a variate ob method Wtt cane “are } te very commen & onte corm gusty prllen te alto very common Tn Static. Trepotts Melee ud chatic crestig Confurton $ Aecluces Ssaclobitite, HHente if thre fe no cpectfic, Sequitomenct they tt News Secemmended “he use state Tmpett. Dibberence Hw tapes ae Stabic Impotk i— > We en ate notwel impett te cea clans $ Trtibees Hf 2 P. . > Whineweh We ANE aa rotmel ingot Te fe not wequiter| & wae We can Wie pra ea Trgert stabic member 9 a clan. a tenever ne ane using ethic import “He can acess chatic members Aisectly withent clay nawe. ————— ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE9505905786 \o gq DURSASOFTWaRE soummons Re i Sap te 20 encapsulation mechamitm he grup watal clone $ Frckerfpentes Po a ingle module, ex: An clause + Trterfaces which ose. Auguined fot ne’ oe : Operations ase grouped tito + separate. pacteage, which | but <4 pasboges En@t AY canes § Mterfay Which ave vyrtted got File xfo SCIP MATERIAL, Operations are qrouped Tidy & cepavoti. parbage , which ft vothirg bal to package - | > The main actvartages ay package Stebirenk are) We Con gecolve roming Comptes. oS » Et improves mointat nabs ily % “the opp! Bt improves moctulastty op the application 4. Tt pwovictes Seecusily. > Thre fe one. univer selly acepted _ convention fol poleoges ieeeyte ute inteanet demain fn reverse wee Ext package corn. duke cobts SIP public. chars Test ab Pe vee) L Fee meg Powe) PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 n } DURGA SOFTWARE SOLUTIONS SCIP MATERIAL @ jevac Tet, jeved! (95 > Guerett) sclay die wit be pleas in co (‘Bare ws) | @ jevac Teak. Jove Eb the requirsed parkage Shruetiive "e not alse. Pe € then “the above command ikcelf ill Create. thal folder structive. > Enstead of dok(-) we Con ute ang volict isectory name, e: [jane A et Tat jen Pye ————— du pate “ip [Tet cley |—> tp te cpaitied destination ts not olreecly availabe “they we wh } | ecg = By zr fs wot available Hy we will gb CE | > A the Hime Op encention compubtory we hove to specified Pb quetified rome. | | Ee \jeve Comms dbaagaceth scjp Tate | CLP: package Dero. Cemchurions 2— Le By amy Tove oregon, Tse, route be edmosk ene packncge Stalzmonk free, we damit bake mae then ene pekage Ghtirset: SSS PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-SO0034, HOBILESS0S905706 Yee i DURGA SOFTWARE SOLUTIONS SCIP MATERIAL ee ©] 2. Ty omy Tawa program, First nen— Comment stalient Showtd be package Staliment Cap ft avatlale)- Ex Pmgert jove util. ALs Absantt- en. packnye Shalit; |. \ Te Ader Praprsrtes Immpotl packages : 1S feapotbont Ary numb larses | Prctevfpaceys | env] * ennai Em An empty source file fe a voli Java preqrom. The fotteroty are valid Tae progranu. Test. joe Test. ava PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 (3 & leu mmedibiers t— —> Whenever We oe waiting ous own clanes we have to provide ahook forme inpormnetion eur clay “te the vm, 2 Thy Rafer ction inclucting A. Whethr thy claw can be aceesile gren ama here ot vole a. Whethir child clas creation ic pouille oA wet. 3. Whelkty Tnsbactiction is pourTlle ot not > We Con provitle thy frperoctiton 41 desketing wit: appro prtete moclifiers. The ony applicable moclibiers got bop lovel claney aw applica froclifies ame > privete, public, calefaulk> g probectecl are Considered as aun specifies and erupt thik atl Aomatning are comatdered 4 acer) modifies > Bub this terminology fe applicabi only for old Aanquages Lite c, crt omd so on, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 ie DURGA SOFTWARE SOLUTIONS SCIP MATERIAL > Bat fy Tova tire fe mo tueh type of femnincloges » Al are ceomiidered 94 modifier only. Cat private clas A i3 _ Cet moctibies private rw alowed se) puldic claves > Ba clas declared a4 public they ne can acco thal clos From oongchane etthiy, witkin ol oukxfde of package. E24! posk oaks Pakage poab2 5 a ee Fmpotk peaks. fs aa clas A wo 6 public void mic) Sioep (% claws meted"); } jane -d« Ajovadd 7 Jove pooere Bde Tw Clay method > By cee 6 Te mak publ “they hie compibing @ chars ne vil ead oa ee c) depen clave 2 7 | tye claws fe debauth thy we can accen Teel clears only vofttin | tee cured package. fre, rer ewteiele package re cant acces. 9 tener ctefawtl” access is cleo known os packay Jamel access, a PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 is DURGA SOFTWARE SOLUTIONS SCIP MATERIAL frat 2 { t SD Hick, 1 the packibin applet det clades, methods aw veritatis. 4 Whetewer pore hos My defowtt avoilable te the child \ | trough iphuitente. > Bp the tld fe nok cebipiel ott Rrek inplemertabion Un Chite te catloned ts overvide thot method battal on itr 4 arquinoment: . ; oe > Tp the Parent clots meticod declarcal oy find th, chile i ! ST : - ret ablened te ovewtde thad method fee, we cot overrvicle \ aa ~ clas 6 entende P | clay ; t Fo attie vetd momryey | public void propertyc > L 4 £ copes casts + lane qa); jin shag staat { 7 ( pubic. Find void marryl) 3 a { . Cer manryuy fn & cormot Sop C Sutbalaleshmi"); = es) x ee ined chewy i ty clay dedoved as Hood Athi me Gort cveeti chitel class Tees we can't eatend ce Pag. Gar dinal clas P L day c extends P a y ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905766 16 ese DURGASOFTWARE SOLUTIONS eae | Note: Every metked present fnefele final ela ie always final whet ne are. aleclaring ot not, Bub every vortabla proest fnefele final clars need netbe dined, >The main aelvaxtoap Ae final keyword fs we Can achieve SeourtlG os ne one ic aLewed te chomge of erbemel mr Frat PEL the main ditadvartage Of. Hiret kequoord is we ere missing Key benefit of Cont: Toharitemee (hy final cles), polgrotphtem Coy final meticocls). : > Bf there fe no specific TeUitenent tty Th ie newer Beecermrnencled S] te wie inal Repodtal. abstract modifick 1 <> abshraat modibua ~ppiectle only det methods 4 clei, bee not fet variables. abshact method 7 > Evento we. dent knew obouk tmplemectation BHI he Con declare a metked with abehact moclifie fee, abshoct methed hos ony declaration bade net Implemedtation. > tenes abelroct method declaration shewld Compalcony onc wit, semiceten. Ufartte abstract votd mit) 5 Xprblic abetvat veld mid y > chetd claw fe vespencile “te provide Tmplwwdtation Jot Revel” oO clas abstract metkody. Ear aletrat clay Vechicle public abetrock tnt getNoOfWheelsc ); | 5 PLOT NO.S6, HARSHA CHAMBERS, SAl NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905766 7 r DURGA SOFTWARE SOLUTIONS SCJP MATERIAL ‘ Bus Veehicle a Arco tends Veehicle ; : pullic. tal getNeOfttbesl) peblic tik getNoOftlheele) — | t erebitrn 5 t vebiivn 35 J y > y ‘ l > The matin advawtnee, OF plactrg shebvcet meted In th povet | chewy ic we com provide guiclllines “te Ike child clan uch \ kab which method ht child hou to jemnonrt. { Pe atetract method wwe ates tact vepemaston, ty ony meted | tales about Implementation tig tka method forme lege! ! combination wits abchack mechipie. od > Henee He following ane vattous Teged Combinations ¢. medibin fot methocts, SR puttte abstract final. votd mild; SSE GE t Megat combination instien of modifies + pabchaek and DD abshoet clay i— > Fok any Tova clan, YH we Aden want olgect creation sueh byre of chars we have “to declare with abstract modibier fe, for abstract clayes initewblation fe nek potsible. x abetvact less Test he rpstv mOH a - a ; Saad treme Teaeess (CETTE ed PLOTNO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG .C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 1g abtrat clay ve alsdract methed :— 4. Gf a clay contains atleast one abstract mettod then implementation L Te net Complete. tenes ne are not allowed te crete abject: Dur te thy ne Shontd declare clays as abelroct ie. Ik @ Clesd Contains oteast one. abehact mnethoal they compulsory Shedd cleclere claw as abc OW, we wl get CE. 2 Eventboughy clay cleeinit- contain omy abehrast- methocy SET We can ceclave clas a4 abstrast A we clenti- ward tmrbeliction abttrost metrods. uO NttpSewint clas fe abthact class, bat Te deus Contato ang abstract memos. eu® Every Adapter class te an abshack, bet it ceesnt certain ony ebchreck metho ds. (| abstat ve final ¢ > Fer abthact metbads we sheutd override fm child clay ts provide Tenplamrenctation, but fol final methods we Can't override. Hence | dint abetraal comlsinction ts Illegal fer meters. “| For abetrect clanses We choutd create enitd claw ts provide PrpEA Implementation but fot Pinel clays ne amit create Chihd clans. tener abstract finel Combination is iMtget fot lanes, “| 9 We cas declave abtract method freide fin cla, bub he Can declare final method frside abchat claw. Fined cha Toate nbitrec clay Test © ava void mAs 7 lane inal votd mics : x re oo thi DURGA SOFTWARE SOLUTIONS SCIP MATERIAL e®: clan P : L public void Sa ¥ Grieg 7 ee A lest _abttroet— Qa@: clas P public abehat void mitd{ 5 5 pelle abstact votd m4i0) Cer Pie net abebact camel y Joe nok overrfele methoel th _ Tp we ore entonching abctract cha Hay fot each ancl abstract metkod porent clats ne should provicle fmplementation, ow. we have te cleclave Child clas oy abstract: abstract char P L pallic abehast veld m4003 public abstract void mac); clan tents ig L pubtcc void mily Tet C te not abetract ancl toch Tot override abstract metiod y mat) in P ne Noter— PE fe bogs a geod Pre Gearing practice bo use abctrack modifier tn out programs becon it promotes severe! OOP te oltre. i shack floating potnt) i— serebty (otver flentng ett) —> Introduced fo 4.2 version. 4.2 version <> sttettp mioctibter applicable for clanes amd methods, bub net F& vosiably, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505805786 L 20 veh) a a. Ce Glehresh P mettre cannot have a & t e@: clus P : Lt - =— . DURGA SOFTWARE SOLUTIONS. ‘SCJP MATERIAL, ' Strickfp method s— [Hp Ueuatly the, remth of Heating potate akithmetic fe vated from | pletforen to plekfenn. i > Up a meted cdecteved as staicttp ol floating point Cletabeens } fa that method has te follow rece 454 standard fo Tab We ! e wit EPoren Inclependert vewtty, i chowder —> taclau deelored os shaictfp thin every Concrete method to teat clary has Ho follow Tees t0q dawderd fo thal ne ory Geb platform Independent ete, Staicttp ve obehaut -— \> Stichp meted talks about Trnplemertation where as abstract method never tates about fmplenedabion Heme abstract Stricttp combination f Tllegat dot methods, “| But ne can cteclave abstract cla as staictfp j.e., abstract : Hates combination ts Aeget dot clanies, bak ileal for methods. fet inn shictie ele Test Yabetenet thicttp veid mit); y O] 4. pede _mernbers Ol t.a member declared 05 pullic ty ne Gon acco that rember Oo son rohire. Ol Bab the corresponding colar Shoutel be visible The.) before checking QL member vitcibtiitgG ne hwe be check clay victbtiilz j)> Hr beth clay 4 members are public then onbg ne Can acces thal members feo eutsicde package. PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 DURGA SOFTWARE SOLUTIONS ‘SCJP MATERIAL i pruleage pacts ; Clay A epee pucks L ublce veil mic) iu & pole vee ee vo me) ' Sop (84 clays methecl’); Me acne ACS ye Maer; jevae ad + Ajava ~~ y Jevac -d - gejeva X ‘ > de “te above orample, eventiough miter method fe public we con't access from owtricle package becox the cerresporcting clas & ( fs wok public fee, &f beth rnethiod amc clad ant public Ikea only we Can acer that meted from entside poskage & dlefaull members 2— > Ip a member Acclared a4 defanth “thin WE Con setts that member wikia the curred package amgrOhere free, from oudelde pockeg. We Camit- acters > tHenee olefawtk acer fe abso Known as prekoge lowel acters. 3. private mnembercc 2— > Up a member declared a4 private “tiny we can aceor that member oly oithiin the correct claw Tes, from cukide tke clay ne cule | eLcer4, ae ~ abchvack method shouts be visible fq th child clay ~t provide. implemewkabion where a4 privet methods are mot vicible be te child claves. gat thew privat obebvact eembtrction C6 age! fer metiecl, + protected members 7— > tha member declaved a4 prctected thin he Can aceon Mabe member anywhere Within cerry ‘PLOT NO.S6, HARSHA CHAMBERS, SAl NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 QL DURGA SOFTWARE SOLUTIONS Ty We can acces SCIP MATERIAL j protected members within “the © curred packege enguhert| | pent Uy Hing pam oper ob chilel seference, \ ? Buk cubsicle parlerge ne Can accers protectil member only by i wading chitel Terence { we can't ure parent reference Te acces | Protected rnembers drom outside. package SE pockaye packs; public clay # S prct ected votd 40) clay “@ extencls A L es oy me) A acnen 73 amt); ~~ Bbenew B02; bem 5 Aatenes BO; at. m40), 4X clay D ertencl © a ps vy mt) L Aenea A; am40)5- PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR,NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE.9505905786 Be poceoge packs 5 fmpost- packs Ay Chest © entench S.c.pltmisunderstood meiteds| 14 v me) A asnew AO; Am); — Cennes CO cem4.0)5 A atenes COZ ad. m4c); yo fn packs. A atenew DL), a4. mA); Ccdenew 00; chemacyy A arenes CO); a.m), Ges mity has probecte} acted We can acces protected) members drorm outide pechaqs only 1 yeRa DURGA SOFTWARE SOLUTIONS SCIP MATERIAL It 1 child chayes ancl we Should ute that child chars child closes Fw Cxmpe, Te acces from C clay we theutl ue C chy Juperence ond to acces drom O Clas we should We D clans = Pinte: Object clay Contaty e'protected method clowcy ond —t Ainatinety methods. Whi oteewing teu methods we have 46 , strtoo Speeial Care. Swromany te pubicc , Zelebault, protected nel private modified ~ ¢ | Viet bene privat Ceefautt> | pootectes} poll 4 A. Within Bi Some a an clay } oC 2. From child clas Ce ] come pockege x a tom ants | og _ x clas Of come pacleago| a From chil) eles Sb onkticle poclenge 5. Fre non—child [ clan of oats tole x x Pretec —P Tr mock yerbrivtes! moctifier fe private mal the moik Ateeyile medifia Ts paldic.. [RE mRIr pete Re > Recommended moctipier fot variate fs privale, where a4 fot methods fe (c. PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:SS0S905706 Dey spi, DURGA SOFTWARE SOLUTIONS SCP MATERIAL Hinel vakioble 2— tinal triton voriolle | > Eb the vals Of voriole te varied from object to okjeet such type. Oy votieldes ave tteol irstomce varies, Fo ery object a separat py A fuente variable will be eve abe, 9 Pot the instance voriablys , we ave not reuited te puferon inittalination caplicitty, Tym will provicle default value. Ext clas Test L ne = mt) See Teak toned Test t)5 y S-o-plt.a}y => op: © a Dh the trike. variable: decleved as Poljoren fttinVewbion onphieithy whettay we eve ating ne wil gb ce. ent clay Test _ Ut 9 tt a Robes — AE pot tatomes venta, compubiony ne hove be puaform Inthidizction befete Conshuctol complition,i.e., the following ate Vedious posite places to puorm tnittatizction fot fint trubance Vodiotls. AL Ab te time op decleration: er clay Tel Sas eee Gi clay Tat © Sinat int m5 4 find tnt a=125 C2 factamee block 3 | PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:950S905766 L 26 [—ounca sorrwane sowuTions 3) Dnside conthructel 7— SCJP MATERIAL Clay Teal dined tak 15 , Tet ) \ \ lone ane the onty plats te parborn Trtbinbizetion fol Trutamee vastabies| 2 Ub we perborn initiclization any woh. ele we wi gab ce. { ext clay Test ! Hine) tab ay d pullic vet mit) 1 ' &. final stable vatiolle s— . | aL the volwe of varias te not vasted from objet to object Ite, | wie 18 nevel recommended te declare the vatialle as Prebouee } VoSinte, we herve to dleelore such type of variables ot class level i bay ing Shee mode : ; 4 P Bn care Of instore vosiolde, fc. ewerg object a separeti copy will be Crentd, Lt in Core of static vatiolles a style copy fll be Creeted et claw devel 4 shoved 44 every oljecth Op tak clas, > For the shoble vaniobus, me one not vequised te purperm initialization eaplicitly 4 IvM will provide default value ext clay Teak © cratic Aoule Ay Pov me) L Sro-pCad; => Olh + 0-0 if we declore static veliable ot Aint thin Compeliory ne should perfor tnitiabization enpiilly ow. we wid ge ce. DURGA SOFTWARE SOLUTIONS SCJP MATERIAL, Gar laws Teal | L 7 a | aa sralie cl Oye Variable A might not here . | B initialined 7 eo ke > Fot final statis variables, compulsory ne cheated pafore tattinbrestio| befpthe clas Loachivg Completion e+, the following ere valiow plates te pesborm Tnitializction fot inal thetic vattatles. ae ae pee ae Gi claws Test Ep clon Tete . ; ~~ E dine) bable TX 25 Hinel ctetic fab a=toy chatic y eas, yy - mT ore teeny ponitle plates te patern Tattiolization dot Stobie vortebes . ; > Ef we pager feitiolixction omg ahene cue ne wit geb Ce. ‘Vent clay Test orl tebic fab a5 Ps vy me ao ae a) a 3. fined Local variotte-.— ‘| —> Sometimes te met tempormny wequitement ap the preqrammet wa hove te clelaie vartalles insicle a mettyod | blecte| Conthuetor Suek type of vatiables ane collect Mecod vortalss. > Fot the boca) vattables vm work provide omg clebault” values. Compuliony we have ‘to petborm initielizction omplccitly, befote wiry het locet vorialle. ee chew Tee clay Tee L L es v me) pavme) PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 27 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Te 5 & Hebe )> y opt yo > 21P + Hebe poperm tnitializction, Bap we ane wet wting 9 Loot vartaMe Uy fk te nel wtquited 1 PAyorm inbtialization eventzeugh fe fe final. ee Gu: clay Teal clan Tek I= i Cee ye vm Htrel tak a5 tinal tHE a5 S.0. pt: Pace on , PCa); ¥ olp + thee ek | Nolet The enty opplicae modtibit Fa local ve vainly te ictole we ore trying to dectore Mth amy othr. mnectifier thy we wit qu Ce. Sr tay Tee L Ps v me) L police tab a= 105 private Trt actos oo protects) Trt a=to; ey eet Dilaga Cana Static tb aa10y Sen tronstowt tah a=to; volatile fat a ato; PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 2g > Rooted Local vortalle cleclaved a4 final before taing oly we heve | Te — a eit DURGA SOFTWARE SOLUTIONS SCJP MATERIAL OO ——,— Zdefault> moditier, but This rude ic applicable only dol inetonce 4 stebic vortatle bub rok det bet vartaltes, go > Femmal peromelia of a methocl timply atk ay Lecal vaatables OL tak method > Henee ne Can declare ferme pavometiy 4 final. i 2 Uf te femal parometin clectareat oy tinal thin Within IKE mettoot We come change itl volue. > ey Tut sv me) e t gamer parsonelos mA(io, 20); a yn a r L 4 v md (final fot 4, it (ogee eae < cammok ausign a velue be tee tit vowielte \)—> Few Intron 4 Stabe Volialles Tv will aboags provicle. aebente vals 4 we one net requisedt te pofern fhitialination explicitly, > Rut tp the ftom + stoic vatiabley cleclered ~ firal thy Tun wed prev de clefantt values Compularny we howe 5 puro alee a ceee oe som won provide dafantt values compulsions 7 we cheuld pabor Pnitialization enplicily befete. wring teak f Variable. This Ante & came Whebret becel vartalle fe final obnt. el PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905706 24 cr DURGA SOFTWARE SOLUTIONS Stable mw ti fi i— SCJP MATERIAL ee > We cant Aeelere top lucl clan as stabie, Lut we can cteclare toner clan 4 Static (Stable Mected cleaned), P En cure Of instante vaitabte , fot every oljek a separete copy wil be Cvoattel , but th Cae OL Static vartakle a Single Copy St chewy Terk Ink 2e10; Static Ta Ye 20; (38). Ps v mt) Tut Hane Tetors tevesers ty 995 Tet tyme Testy cS y & op Uta aah. Sttey) y 9 ow: 0.2445 ee acces Stobic. members Airey fron boty fustomee + thitic ered, bud We Can't aceory Inttomes member Airey deo Static, ahea, > Rub We can aceeyy frutenee membert ctinedly gvom trstomce alten, Qi Comsidet the following declaration. Te hr aH 105 TE. static tat a=toy DW. public vote mit) sepeus BL. public shatte vetd mit) 4 s.o 5 So. pis x ‘PLOT NO.S6, HARSHA CHAMBERS, SAT NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE.9505905786 So > static fe the moctifiet applical onty fot variates $ metpety WI be creatie ot clas Jeuel + shaved 4g every object of Hatclaws, ! I 1 \ 1 ‘| « \ 7 1 | ) | | | DURGA SOFTWARE SOLUTIONS SCIP MATERIAL =P Witkin a Clas whith of, WL tolteroiny dleclor ations we con tote e- Simattane evaly Teste ig “Teab) fs not «Mow km Dlotz:~ fretamee 4 stable Vatfables soitty the came nome bx frttomee § local variably of Ctalic # Roce vatialle crn have Same wanes abstact ve stot > For static methods compulsory aveillle where as fol alchoet methods fmplomrentation theuld not be available. Henee abctraet” Static combinstion f fegal fot methoots. Careld: . . SS Ovetlocdbing conupt fe applic le fot statis methods fretuclivg rain (-) fm plemectation should be (| rnetiod. ales. . _ 5 Bub Tv tc abways GU Sabg lI enguerent- method onty. ste ofa, owstoadedd methoty we heme be Cl onplicitty thy ft will be erecutal jul Like newnel method ou. lens “Test .s es v main Cohtegea ang) L : on , op Shing ed; Vg) cv main CPt anys) doe 4 Loop Cintoays | “ y ole: Stage 7 | PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 . ar L = DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Casi? > Tohusitome conupt fe applicale fet totic methods Tockachow rain.) method, : > tence while ene caching ehitd clas tf child elay doers contaty rain(-) method Win patent clay maint + method wilt Le eecectecl, ext clay PP tC t - F Ps Vv main (SHigcy ony) pete’ ely S07 C "pavent maint); jeve Pal ‘clay C entenels P elp t parent met L java ciel ae oe 3 lp + parent matyy) pe P eS javac P.javed ad 7 Sop CO patent main"); Pilon Cocke jeva. Peal ap pee maty joa cel Cinemas pov pala (Shinged op) i yl clay C entiney P fir & Ps v main (Sttycy ony) Bets method hi. but! ~ Sep Chohitd main") 2Ip + Chile macy d - ey! <> Th seems overriding Coneept Applicate dA stabi metjocle, bub fs not overriding om tL te methed Afeling « Notet—Emside_a method, 4 we ove witng omg Tnutence varLable Computsony we Should cteclere thed- method a4 ingtance metbad, Enstde a melody we are not wk. they we Cheubl declare Gat metiod a4 tetic whi ne ar viding ctshi vatiallie of wl, PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 oy et clay Native eles Chie at Stedtic. at vo mH } ryt © Lood ' »: : e PSyslo-ood Litany Cnative. vay path); Nebie nemey Native Livreriey) ¥ jp DURGA SOFTWARE SOLUTIONS SCJP MATERIAL i Se clan Student (GelCalle Ronee) Y Skaing nomey eric 1 Tab “mew y _ : int wollnes Jet GtucledTefol) Ny fo Gtving cmames t Sete Sy Ser etree creo pokite Ching rien} > ae = frst? 1 < . i a ao, Fiovoge nt a, H Podtc. tok gob Maker) a lors; | ce * stare marks; a 2 ‘ wr oo Nocive. :— > native ie the modibit applicalte onby fol methocts but rok for clades ond variables, > The motmods which tan be implemented fo non—Java Crneettg and Or) ame cabled native. oA fotetgn mneftiods. 7TH main pusposes of native Keyword in Tava one 4, Te improve performance oO, th system, 2. To achieve machine level Communi cation 3. To tHe odaaady Bee non- Teva Cede elt. Pseudo code “te we nate te gore In @ be whbic native void m4); native; meted] 7 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL ~? For natie. methods implementation fe already abailate + homer We one mek responsitle He provitle. Implementation. Dae to thig native: metiod declarition shetd ends wit temicelen CG). | 1 & Palle native. verd macys : pate native veld mt) I a[Ce t native methods cannot) | abchroastk Ve active s— have a bony > Fer notte methods Tmplementabien fe alreacly available where as ebchech methods Tmplementatiin shoulel not be avatlate i cHenee abetroek native. combination ic [Megat fos _metioels, native ve shicttpi— > We ot declare natie metbod a4 Shrictfp becow there fk no quorantes that native lerguages hllew feee 464 Shonclerl. Hen native chricttp Combination fe Tegal Jet netics. 7? Fer native methods the dolleoing conepla axe applicable \ FTL main adwamtare of ncbive Keagwore te performance will be Amproved, bul- te main clitadvantasp Of native Keyword fe ft breates platform inctepenclent nate of Tava. Sgnchronized Scergososel aed Speshwentced macclibien mpplientle onky fol motos 4 Motte, bat not fot clacsey 2 vatiatsles. —> 2p multiple threads operating Simultaneously om came Tove objet ty Hire may be a chante of alate tnconaistenty problems 2 TS owtcome thy problem we sheutd go fer Lyrelwonixest Eb a metted ot block clectaredl a4 tyrebrontxect thy ata Lime ony one thread te owed te operate oa given meted ot bleck re on the given ol PLOTNO.56, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 By L —__— DURGA SOFTWARE SOLUTIONS SCJP MATERIAL | 2 fo hak we can secolve late To consistency problems. PT main advardage ep tynchronixed buyword ie we cam everceme ate, Tnconsistenty problema > Bet The main, Rircalvarctagy, te Te Tnoveases waiting time oh Greacls om Crealg performanee problems. AP Hene if tive Tee no sperific reguitement the fe fe newer Aecommoneded te wie cynchronixed keagword. ~? Syrohronixed method theutd Compulsory contain Tmyplmrentetion whe 04 abelroct method theald not Contain Implmreddation. cHemte obctrott Synchronized Combinatiin fi iM _ methods. tranciont Begroeral ae > trantiont modi bite applicalle only fot variables, Lut not fot metros 2 clerics. Bre cen ute rentiont Eeyore tr Surialination. [2 WL performing Sairtinuhion if ne clerk ‘te saver the Value Op & posticnlas vartalle “le ment seccurity conchainle. euch type Of Variables ne have bo declare with trameiont” eyword. FAL the time of Leviabizetion vm tqreres oléginal valor oy trauton| Vatiolle f cave dehantt valuo be te file ed PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-SO0034, MOBILE:9505905786 cL 3s DURGA SOFTWARE SOLUTIONS: 1 Voledth mockibiet 7, oplt ; , \ > volatile moalifier « enty fot vartallrs bat net fet metmoet 4 i Clises. i > EE the value of 4 votiable Keep on changing by multiple reacts hin trove may bea Chamee of abit Fnconsistontg problems | To overcome thig problem ne shontd go -fol volatile medtibier. I | I SCIP MATERIAL calde > Ufo vartolle leclevect a4 volatile thin fot evry tread 9 Kepiate copq wot be creatia g atl Intermediate medificchions 7 Pformed by thet thvead will takes plate fm the Letal Copy~ So Tut thee fe no effet on Premaining threads, s I ST main advantage of volatile Keyword be we Can overcome dey inconsictenty prolems, tuk cresting § modrdotining a fepawle ! Copy. Jot every Thyencl jnereats eompleaity $ creat purbermense: | problems « Prtlenee volatile Eayrcord fe abmact cubetotiol 4 mot vreeommencled te wie, > Vdatte vortale mean its value Kap on changing Where os ¢ Hind vokiodle means fee value news changes, ) meee Heate volatile final combinabion Te iMegel fet variable. ‘Conclusions: — The onlay opplicatbe. wedifin fot local vatialles fc find. Tre mechibioe: which are applicele fol constructor are publit, private, protected aval The mectifiee which ave eppiictde fA. fn claney but not ot ont. clases are privali, proteeted anc ttibte. ! 9 Th modifies ushich are applicalis fel claves Lt rot fot trterbrees are final. 5 The modlifien which ave Applic fol clases Lut net dot enum erre. Hinel and abstract. omy > The moclifiers which are appliatte fel metbects nabre. The mcotifiert which are appltalle onty fer variables transient $ volatile. PLOTNO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905766 36 Lb at 98/506S0S6:a'IHON “¥E000S-UNaVHAVH ‘SHIMON 9 918 YVAN'UVOVN IVS ‘SUBEWVH VISUVH 9¢°0N LOTa ———————————————————————— SS Soaeeteaeee erat ders i 6 Pospouyauby 3 b apessye 3 3 z T T. HS aerred | | | | eal | af an 7 | [sre pre ee eB] cai mreyo a oe A a Fpougeus a a _ ea | myer mm In] OE \ A \ \ lea eee | T es ror BiyayO 19403] ao Gare MATS. WhHALYW 419s SNOLLMOS 3¥VMLIOS VOUNG 4+ trteafaces S— 4. Batrocuction 2. Interbace cleclevation + Temple entation B emtends Ve Trplementt +. frterpece methods 2 Teterpece vyartables § Teterbets nomeing Cor A. Metiod naming conflict R VaRialle veming Conflict SCIP MATERIAL, ' G A. Market. futexpace ; & Adda pter clans y 4. trterpare ve abstract clay ve concrete clas | ¢ WO. Bibberencas Ho fiderpese £ atchact clac, 1 A. Eytaocluction s— 4 7 | 04°70: Any ceavicn Aequitewedt epee’ fication fc Consicleved as an. Trctenpote- ea@ + tpec Ara cel 05 Tequiement specification ty clevelep obtabase Driver. : a Pulztare vender te responsi te Tmploment tha «pecifiction, SUN E2@? Cawkt APE a2th a4 reuitengent Lpecificction te develop mebeewer, websewer verte te verpontilte to provide tmplemectahion, 56, HARSHA CHAMBERS, SAI NAGAR NEAR BIG C MOBILES, MADHAPUR-5000: Be , MOBILE:9505905786 i- DURGA SOFTWARE SOLUTIONS SCIP MATERIAL sunt froeblogic) webs phere Sewer : DY@: From the cheat potat of view, frterpaue clebines the sob op Sevices han ie enpecting. From the sevice provides point o view, ftewpace clafines the cet hy sewias what he fe offering. € Hen frtecpare acti os Contyort Uo Client $ tervice provicter. EX! From tin Cuthomer potter of view ATM GUE Leveen sepresente He sd oy services whet be te expecting At the come time the GUE Screen vrepresenlg thr
    A clas Can extenel only one clan ot a Dime here o4 an Trderfpose. Com encom — omy ro. ef tnterboees £fmuttane outlay. Tobespace frtepace 2 i 3 13 ee ae or > A clay can Implement omy no.nfrtespacet Simuttane oust, > Adley can entencl amclKit clars ancl can Implenent omy te Of trderpates Chanes XY,Z should be Toterbaces es ae © Wiad va) o [eagient Vox | ae: Gh bear ve hove te the eee trtends first followed My n elt. ] qe. tntesfpace _methocls np eo 4: intupeu methorlt — Gory _frter pase method fs aloo poldiic sabehoct whither ¢ we art. deslaring vot, (4 ear tatevbour. Enter il void m40)5 3 petites To molec they mettiod ewailals to every : | Tenplemrowtation chord, abestrat Emphrectetion claw is responsi be fe fonplemete Ay mettre, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905766 oy DURGA SOFTWARE SOLUTIONS SCJP MATERIAL Heme the follewing method oleclarctions ave quel inside Paterpaue. Ext p void Aly | pullic. vetd ACY; abstract wold mAs ow? poblic abstract vetel M40); As ewory eterhaee method is always pubic $ abshoek whetkit Ne ave clestaring of net, hemee we cant cteclave boteepaee metbeds Wilts the following moi fins nel private Seprebvronixesl CRS Protectec} Cite static nucbive- triettp @: WK OF the follewsirg nethedl destarations ore vabid) Trafete interface? X@. pallic. voTA 4043 K®. private void 40; X@. provadsl void rt); X@. static vetd mid); XO, public abletract native vera m4); ©. abshraet public votd m4c); 5: Prderpoee vortoes 5 Am fntrbace can contain vortalles. ; Te main puapote op interface variates fe te depire aequivement lel constants. > every terpenes vores: fe always public stable whether we wre aleclaring ot net, PLOT NO.56, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADMAPUR-500034, MOBILE:9505905786 42 DURGA SOFTWARE SOLUTIONS Eat tterpae Dnterfy po—tat 2 =t0; ey | 5 public ¢ Te make this vatialle avallobie te eveng Tenplemnentastion clay. SCIP MATERIAL |» otectic Wile entcting eject atte, Implementation claw haste cece thie variable. L_+ final ! Dmplomentation clas can acceny this vartale bute Cant mredkiby bern it fe commen vartolte fot Severel Implesentatien clauses. Hewett following wattalle cleclavationt trside frterbore are quel. Int rato; pol. fat A ty cl Sebi int a =105 incl fab a=10; Public stabic feb AH10; 7 a puilic. dinel fat a=10; Stotic final tab a= 105 _pubte stitie din) tat ato; Ym Ae every Frberbace vortalle te alongs pubic chile final, we Cant clectare wets Tre ctellowing modi fie. L 48 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL => For the Prtevpece variables compuliory we thoutd — perform initializcttion of th Lime of decloyation only, ono ne wt gq ce. interpace Peteate dl. Sars ink 35 EE = eee) ; > We can actors interpore vaiiables Incite Implementation clas bab we Carl mectiby. es interpete — Qecteade Tak a= 105 ¥ Clan Ter fmplernenté Znterf | clas Teck implements Excterdy ys ov me? es v me) eee, Pr a=aag; Sop Ca) => olp 299 y? QI Which a the following vartable cteclarations ave valicl ? xXO- fabas KO. private int antes KG: protect Int aHtoy X@- volati. tr a=toy XO. brane tr a=t0; ©. public cheibic tet a=05 PLOT NO.S6 HARSHA CHAMBERS, SAI NAGARNEARBIGC MOBILES, MADRAPUR-S0003, MOBILE.SS0S905766 omy DURGA SOFTWARE SOLUTIONS 6, interface meen compli Mettrod Noming Condlicts 2— SCJP MATERIAL Come: 2p two trtevpaees Contain a mettoet Wily came signetive, ond came vet type theo in the Ten plementoction clas ons metbed implementation fs enough, Ear Interface heft Tedupac Righi t - © ute void m0); public veld mit); 3 y Clas Tusk fmpbvronts Lebt, Righl- L pullte void m4) L ae a Ep two fiterfpoces contain a method With came name Care lout with chifgerent on gumenti Wig fy the Implementation clas he have cto provide Trnplons entation for both methods anct thu methods oti as overtooced methods, Prbeagace hebt cee Right tice vot mit); pall votel mt Cint Ns 4 y clas Text tmplornonts Lebt , Right y public void m4t) wal 4 3 oe petlic vetd milfa-D i 3 5 PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 +s DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Th two fleas contain a mettoc witty came Stqnabiure but olifferent retin types “ten fe te fmpostibe- “te tmplemet boty Trterfates cimulban : Ext fnterpace Left Totevfpace Right | t : i public void mic); pute txt mth); \ J 3 We wen waite ong Fave chew hich Tmplemerk beth faterfaces ¥ piimultancousy ( Q: ft a Jarn clas con Emplerrent omg me Of Picken pees Simultaneously ? . ic same Art Yer, encept if two TPrctienfrecs covtain a methed wi faroe. | ~ stqnatore Luk wits chifferent vetirrn typed. { 2 Unerbeee yetiolte nemig conflict 4 Ceci two frterfaces can contain a Vatialle with same } : nome $ thire may be a chance of vatiolte naming Congtict bul- | we can recche by utig fiterdeee named, — ae heb frderpote — Righi— \ int angers fab ananay i , \ clay Tet treplenente Lett, Right | : Peo v mc) _ _ Ei porn Be at arsbiguend) So p(Lebt a); => olp : eee $0. p (Bayt ays xy Op 205 J ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 46 sea DURGA SOFTWARE SOLUTIONS 8. Adaptu_clanu 3 Clo Up ne tmp tment an Whetger we are & clan Tat e Tnplarnents x ~ ek msc) = w Ling i) mand ¥ pry molly oe red Ly pT prebl th thy appreceh programming: Car thterfpac K © nae; m4aord y m0)5 meoLy paee Oly mip000); miovol {3 terface Lidectly Compuleowy we shoutel Provicte. fmplementaction dot each 4 every method of That frtevpace. fnterestesl ob not. te amd ve chuces seadlabilily, fe inereates complenity o We J ee ne can reche TRL prcblony by wtiy Adaptn claw. | Battenal of Tmplimredbing frtupace df ne cabend Adapt elas \ tty we have “to provide Tinplemwutsbion only fol vequredl methods, but net fo lotel metiods O interface. SCIP MATERIAL, —> fin Acteplt clay fe a simple Tava class tyeto Implewnemts on Tnferbate witts erty empl] implementations. abctract clay AdapterX implements x { foeveases Mngt of the Code. 47 ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE: 9505905786 DURGA SOFTYPARE SOLUTIONS SCJP MATERIAL i Gxt clay “Tet tatencls AclapterX| Clans Demo ealimelt Aolapteny ' t mae) mac) nh dn 5 y 2 The colWVantage Ch thy approach fe levy Oe the coke wih be i . ' y ! t seduce! 4 Reaclabttity wit be impreveel 1 Jen We cnn clovelep a cere etitcr by Teplewn eating Sauk ftepae ot bey artoweling Generic Combet. Ub we ferplorent Cowket Paterbree Airectly thin Compal ovy wt Shoutel provicle. Preplementation fo ol methods of Suubb frterpase wheter \ Te te vequited ot not. ( TH Troveasey Leva of the code $ reduces Aeoalabibits J Enstend of implementing Lewbb thizrfaer clidedtly ih we } tAtend Generic Sesubt thy ne have te provide Implementation "| | | Generic Sit (aed) atl Sencbing Seavteb Cot) dot aaquited method ceviced) ond we ave net vespontilte 16 Implement ol Suvkut fwterpace methocts. Hewes mele ot bis GenevicCervbet acty as Actaptir cla) for Suvbt foterpaee. PH Marker tnhupaee > fo Interface which dounik contain any mettieds amd bey tmplomerting “tal frdevbeer if our objects wofll gah come ably Sueh type Of interfaces ave Callet Mark Tlerfeces. — > Marloes) trterdpcecy are alio called my CA) Tagged fnberfraces, xt Leuialiccle —~ Cheneable. At thee fcterpercey are rewrkect RamclorerAcceys ge Lome abitiG. Sing lo e. lock PLOTNO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE,9505905786 ae DURGA SOFTWARE SOLUTIONS SCIP MATERIAL E20: Gy implementing Gertelizalle trterfpoce eur objets can tyovel _accrou the nehwotk 4 tan be Savet ‘te a -fik. EA@: By implemecting Clone able frtivface out objecti con alte cto proctuce enactly duplicate cloned object. Qi wWrthewt having ony methods how we are ging ability To marker frterbaces? Ans: Enternatty vm is rapensibe te provtee required abril. A i i RE voky sum Te provicling srquited ability ty marber inter feces ? fou: To Aecuse compleai ty Othe Progeumming- = % owt own marker faberbeced ? @t te tb petsile te clefine dyer Yes, we can define eur ew rnayket fnterbaees but Custornixati- on of Sum must be requisect. EAL Sleapalle , Tumpable,—- ~~ 4. intepare Ve abstract claw Ve concrete clan 2— R_intabate Ve > Hp we dent know amgthing about fmplementation just we have Asguirtoment speetficttion “they ne Shewld go fot Interpecee. . |ext Settee > tf ne ore beoLeing about tmpleme-ctation tea not Com plilaly (Cpoatiol | fexpeenentection) trin ne shoutd go for abstract class, fear Generic Seavbt Cre) > Up we one telkt boul Implementation Comp Whit + creaky w& provide suvice thi ne should go fA Conevete class Ex Mall Gemoling Catit Cce) r DURGA SOFTWARE SOLUTIONS Natl Couding Servlet Coc) ae ° 10. Differences Lo intesfor § frterpoee Implementation just we heve eeqisomedt speetficrtion Teg ne cheutd go f& Fncterface. 2% Every metsod present Ineicde fterpaee fo always public + ebchraet Whelan, ne. ave cleclaring A not, 13. We Cant oleclarve fntertnee metboe WTB the followfng modifies privati, protected, cette, dinel, Synchwonined , native + Chicktp. 4 Every vastable preyout- tefole Interfere fe always public static Final whelk ne ane ctectaning SCIP MATERIAL Sedat CL) 5 Ancry ‘ 1 tak“ CA ee el eee eee eee Len Http Cewtet Cac) ara ae > Fullty Completa} Building Cee) evened frnplementation but not Completely Cpastiol fmplmontation) Hay we shentl go fot abchast clas, 2 Srexy mettod proect trutele- ahetroet clas need not be pull 4 abebact, we Can bake conerets mebjeds alto. 2. Thee ave no restrictions on abctact claw method modifier. # Every vtialle peeyant fratde abstract cla need nob be pablre state firol. a vet, PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNNEAR BIG C MOBILES, MADHAPUR-500034, MOBIL E-esoso0svee so DURGA SOFTWARE SOLUTIONS c tiie _ 5 We cast decane frterfaee vokialles with the Pollewstng rectifier privatt, protectist, tromtiet 4 volatile. SCJP MATERIAL, abchadt— clay S. There are no vutvickion on i abctrack cleats vartalle modifiers, | 6. For fadetfau vartabes Compuliory we sheutd perborr fritialization «+t tte time Aecleration, ot. ne wilh ger 6. For alctrocp cle vatialtes Which fe not requived te perbows | ot “the time. of cleclavation. “| th Pneide Prterbace we cant Arclave static g Mmitance looks, €. Pnsicde interface ne cand take conetrustet po A. Tnelde abchact clay we on declare fnetanee 4 Ghabic blecles. & Pnefde abstract clay ne Can becke Cometructol. Ee cant creat object fol abstroct clay but abstract cles can contain constrict, whet f th neecl? CO] Pett ebatreck clay conchuctol vill be enecatel to perform Q fnitiabizction ef chitd oljet at te time of child objet OF} pare eter. —_ of NoG :-@ Efkin airectly a inctinetly we canit create object fob yf abctvect class. 7 @ Whenever we ave cre, ehttl clas objed parent comthructe : woth be exeertiel , bul patent object went be cre ctial, Qi frterpaer contains only abstract methods, but abthat clas also can contain abshrack ppethects tay whet fe Ine need of interface] es ‘PLOT NO.S6, HARSHA CHAMBERS, SAl NAGARNEAR BIG C MOBILES, MADIHAPUR-S00034, MOBILE:9505905786 s DURGA SOFTWARE SOLUTIONS SCJP MATERIAL @) 2c ft possible te weplace faterpore comeept- Wilk abstract clus? mt We can replace a a goo programming practice (which fe Ailee vecruiting Tae officer. dm troeeping purpote): Approach O: Approcsh Os abstract cle x Paterfpoee with abshaet chats, bul fb ts take ce X ey (53 Fmployout X clas Tat entence xX oo Text impl 4 y y @ Tek claw can extend some @ Test clay Comte extent othe, clas vohile Temple eating oth, Clan vohile entending x ® Ajet erection Fe not costly, @ objut evectlen te costly. Ta bones TAT [Tae ome Torey) Lo ni 2min 9 > ib everyting te alchaok they ft is highty wvecommendect ee ge fot Pntespuee. ot PLOT NO.S6, HARSHA CHAMBERS, SAI NAGAR.NEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 5a ~~

You might also like