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

New Core Java

Uploaded by

samsulansari1650
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)
67 views

New Core Java

Uploaded by

samsulansari1650
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/ 156
ee —fpesraning lange 7] Regraming language += Rt Language _whith is uted'to |_ Communica a= 2 | Enatish Language ——»}Co Communica a | Je_ond_instau Hecomputerte Perform tea |.tob. oo tempter $$ sgperer ‘ je itis a_easily Readable, — wi Low Li =the Languag lat by dhe achfne_and/ov Compu ts knownad— pw Leve sn ote a ea Lage — H | example s- Binary Number » 0 + 1 I _off on Catt apo o hmen— 1 underlandobie_and-Sashuct_by the patypammen oo human — example t- Sava, .Net, Python, c# | Lt TEL Olin Compiler 01001000 zi T | ° \ooo0elo-——> | [A iby ee Human Leovee| | Propanney Computer Binomy compuler)mabine | X Lanny a Lachine Texel Lanecge]| ie [tow Level Language] | undenslond_ uct es Taud (abled | fet) cao [Pilico) ek Scanned with CamScanner ia —ASCTI :~ American standard Code for Information | “Inlercchange A = 65 Binary oo I B= ct ' of fefe fi Jo Tefoy as o| 42 Ot eee ee O - 63 2] 36 ° Eis 63 2} 18 ° Fs +o 215 ! qh eas aaa Ee. ' 1 Scanned with CamScanner Platform dependent. += ‘Lwe tusite pram one Platform we can execute jn_only_in the Same platform bul_we can nol_exetute.in-delfirent- platforms known as ! Y Pla\form dependent, example. = C————— | Pialferm Independent‘ Ewe uuathe He pxogaane by ustng_one platform uie con_execube. in_any )_plaferno —_ is Known-at. platform Independent_ts-1 yp od example +- Java [Platfoxnm = 08 + Poocerser] Bi wid Heb fi Liles 64 a o1oeeioo x cast "Binary = a “wid Thad y ae . J Plat fosm dependent] ‘ Be Mac bantu ml Hebel Comp aa CUBE wid + 1 way — cs rua Sip fe e i SS wid + c _byle code fe Sree a Class fite dx NET source code inlenmediale, nee file NEI [plotioasn indeoenaarl] bart Scanned with CamScanner (o) 8, alan why Tovu_is Platform Tndependnl. ? a to byle cade file | Becuse in Java Source Code file. 8s 'Convented: Ya Plat form which hey tobfeh:con be_exeeuté_by any. a PP es aan oe Tot) = (@)_* Dilfercnce Between VM TDK, IRE f Ts ae “Oa :- 7] fhe slond for: tava va Vink po ) {i gut takes bytecode as faput-and = Nivtual machine. ee Senerrated bfnany as oulpub. Physically does not exis! ta . 1 Jv is Platform pendent but Ive makes Javaar Platform Fndependent : L 5) Tvel_constst of Joterpreten and srr 4 —litsidet< ts dhe ond rate ticbyccale sx _imulfaneouthy but: tne byt ne. _ q ——{ hal ane thing happened Hh ~Tnterpreter 9s the more time — —] ———___s)oterepreton directs eveule the bye itpaa eee —] tp exetute , thal! way Tastalling on ofhuane $1 known at | rT. Jat Sir: =i %< a used 40 Inemrase peed_of execution. H A IT ides Some_sel.of progam wahth.ane Hovey ——____ Same ferfunthion and_compies } heat ances once ~ Then Ve 4c give to Interpreter, — ___ Beeus #311 alnesdst det chk ond compile fue byte Code. ———_______ cet s_sland for Justin bime_compiler Scanned with CamScanner (mmm) [ome] J J tl @ Tee a ek +) fits sland for Java Pun: Time_environment 12) %. $s Dravid priv to yun Tava_f2092am p | i ically ewighs ——H TRE Land of set dnd dnt bongs Cals Rie) a @ TOK :- - : B 1 Scanned with CamScanner Hae Scanned with CamScanner g}- Ht ie : = innt [Bye | lode enter Guilt athe Brey ie Rite] g Jo rity om bjend [ORS = in ‘ont E. 4 ye [one Hh Delepens 3 : Envionmeht x Fake | of. Toa Bus fence | @|_Stmpre = 8e4 nears TS 45 Hoe_sfenples Laing ag, Frnshuel Ly Ihe.grogrcmen that $_woi}——~ @| Pro :- Fase usafie one program any —platfoa — tuie_can exerube this pxogaam_an¥—————~ diffenent foxno. — ; atid aad \he Platform Tndoperdent Language. @®|WorA :- Wefte Once Run Anywhere. a= Nene * Compileac, compilation happedl * fast- Inside JVM. =O) High’ Performance += Beeuse ot 111 (sun in time) — — EA Dynamts i= Alemany cated_memeny} Aga uouam Auloma Jealtocated. id mem te : a t= fluk add_naermosy ond Adamalaly ene ml ©) Robust :- Becouse + check enrax lwo times re it §s_Complien th meand ond itis Run ime. Scanned with CamScanner BL Secu t- Becoure of SPE. aie Soubce.tedete a> eam __ execuperst 6” 0? a Hort. t= Object— (ritented 0704 ming. Nonguage TOL Mu —Threaded ‘Langue ge ‘= In Jove we. wetite One. progam whe ton eneruse_raultiple. task, ——§ (9), Free and open t- % % Source Gc open ond Frce. 40 use, iy Sobtware, ond oily callable . ae ¥ Ps cok Vantabl Q_Local Variable. 2 Global » Variable ee ____GSilobal_ variable. crane Pa Class I Global area 6 Bock |” — = Scanned with CamScanner i co a a | @| Local Area 3 Vaniable create: faside. Loial Moca ts known ay) _Lecat Recea.. Mave eb eA ____ J1973 : a eR Ff . t Public static void main (Sping C Langs) - ae 4 T {1 local Arca ain fni_a= 10; \-toral vamiable block : L cet fs 3 3 Rules to uted Local vanfobte y local_vanfable anc not assigned tufth defualt value» __ ; r Bera | : 3 Noke f= twe con use. aswell as Gobdl Area. Adhar card Clot voriobe) Pasport Clilebal Vareble) CM = mumbai Local })—) fine 7 inal po altar Pradesh Sen = Maclhy paacteshy [ (étoba) ) Global 5 UR 7 U x \andan mee Scanned with CamScanner Pro Na] dan ___—-Public static void_main (String £1 ngs) Snk_ as |) Local van _ System: out. Printin Ca 5 | CTE ' 5 eh _ciass Po 4 i i in in 2 Snt_a tos I Local var double a=20'9 5 // ‘cre g 4 | crass Fe 2 % Z §nt a= 105 J Local var 3 jysaeen oul point In (a) 5, |] CTE 4 J Output $= Error Scanned with CamScanner Methods.» ( [Methods » CFundiens)= C2 ——— ye A beck of slalements ured 40 Perform Spe Oe Soe (oo of; a oe 4 f => Stake gy Cocale the teHiad For Nolume bute — Chiat) £ ee 4 ty el nn ftis called Fone pustizads when we call_any_humbes of Hes. ———— || global Anca $ Scanned with CamScanner oulput $= Main meHeed begins Hi bady Main meted ends Scanned with CamScanner 2Qshol2020_ ae | _— 2 t Bee 206 - [8 baum ay slack ante Figs. TRE S > maine) (main fundion cal Hixsk) a | sun C a “Toterpreleor 7 | aceon as j 5 [Ete baby? main’) z Le fae (3 ~ 1 z SheelaO) - called Melied = Sheela pao rekon p q Chmain begin ~ j F *Shaslert3—$ | Samed as MeHed Acca. Maia O=TallTag Mellen) R | Stack Area | eee aS fF Melueds gels execute only when itis cabled : Aalemaillpdald none} tod_juomalialy tonenace punerp nemo ve. after it acsumes where it stops. ——— Scanned with CamScanner Comte cles Consiel ch qld metal to Perform addition of dua Numbsns. SL esas Pa o£ public static void nd é Jnt_a= 105 Peer aiiiesan: int_¢ = atb3 t Systenn- out printlin Co) 5 4 ra . ~ouk-printin (“mains ing” )3 ids aoa alling MeHsed | 4 Scanned with CamScanner Class Py cs £ Public sialic Void add int a= 10, b=20, C=90,d= 40} int ex atb+ctd § System -oul: paintla (25 a Public state void Sub () int a=t0,b=20, ¢= 90, d= 40g, f= 50 $ ink @= G-b-c -d@_F 3 Sysleon-out Paintin (e)5 + Public slatic void multiply ¢) 5g | Int Q=10, b=, ¢=4 d=i2,@=14,6=1 + ! 5 t int G = asbrcrdr tte 3 ota pn n(Q); Goo : Public Static void divide c) | | int a= 100; | int b= 20: inte = ash ] S ' | stem Dub Println Co) 5 Ig Se Scanned with CamScanner ) | eee static void main C Shing C1 angs.) l System-out-prinln c ae | odd eas a ! Subl)5 ‘ l multiply (04 ue es I ; | ideO3 A ] karan i 100 1 = 80 | 144 840 | 5 oe r J [se SS a | mato ey San | | add ©) ules Sub) | Sab Os | | muttipty Oo Woe 5} | IL | file 0) add 3 TET foetarn | el S50:P (main Bigs); add (5 subs} —t MeHtod Avea rutin si LL} divéde OS isa Main metrod | Stack face & pls exec only went ircalied Automatically toadd memory a Tater sen MEME ables tx Ik Gesumes whereit SHOPS Scanned with CamScanner wednesd = 26/I0120: Pron Na Dae } “Tyga Metinds =" fe Leiner bye stein der 1o_angtument= Method —_______—— ho_aagument_Mel hod_t- ‘The methed which does not have. _ |Any_fonmal_angunment- fs called e_no_drgument Meld | Pasametortecd Meltiol $= The rfeltod cvhich has fongnal st dagument 2s calted_as Parameterized Melted | Emmal_angument_ CEA) $~ Variable cacale aside the pteluel i known cs Formal angument CEB Slalement §s_keown ai Actual anguaea (Aa). Ts 2 Scanned with CamScanner ; of Vontoble execs 'n® [SF Sy SS voided | Public Static void ‘add Cinta, intb). \ H 2 Co Wes2e ‘ Mink a= 403 Snt_¢= ath; { Lint b=s03 Symes \— i fnk¢ =atb: 3 — a \Gyshem.nul-Print)n Cc) s a Static Void main (Shingc Jens 2 - fublle Stale Void man (Spiny C4296) add 15525) 5 el 4 : add (30122) 3 +6) fat Ladd 5 add C40140)5 = Tf pddC 5050) > (Cdate passed msde t % Mebtod Calling Statens —— J yultpul-| do 5 a oubputt=20 $0 $0 190 : Metheds i No Arqument Parometerire ed Scanned with CamScanner oo Chee ola Sel mttiay meal 10 fo Ny ee ae Lok 4_Numb, tors Py oes sattes : s $a ii inks Public static void multiply Cin. Gbiteeviord) = ; | Yok: Sum= Atbterd $ Syshem. out:.Printin (Sum) 5 5 Public Static void matn Céning CJ orgs) < Muttiply (10121314) 5 J cae Dutpub sj 240 — class Po. < Public sialic yold multiply (ouble.a, doubleb double ¢ , doubled’) zt double Sum = atbee#d } oo C Sum aT Staite void mein CSring crangs) multiply Cio.2 , 2149S, 4O)5 $ out ¢) Scanned with CamScanner peer $03 fons hie int » glethed LNG load ny __ class £s_having_ move than enemethod with Game iMeaen t= foomal_argument. ates pS ee data pies oe Samp ] Create Calculator with addition of “2. lumber. panumber, 4 plumber, ___5 Numbers 5 arctuan-data_for each melhod, Slove Ihe relaun data i and print = class Py wats IE} ; —_______ ublie_ static int add_C §ntas fn) b> | $ nk Sum = atb H seturn Sum 5. [4 = tl Public Static int add (inka, intb» fat oo u 2 Jat Sum = ad bt+c5 _ Seturn Sum 5. ese | 3 — | pubite static tntadd Cinta sind bine jintd § fn} Sums atbtetd , Telumn Sums eae ee 4 publ?c static fat add Cinta int »inte Intd sy, Inte) ‘ t Ant Sum = athictdte $ relunn Sum}, _ a Scanned with CamScanner eee je | public static void matin CStatng ¢4.urgs’) fen add (.10128,.90i 1) oui sk ie U0) 5 faviizo. sous System -0ut-priatin Ca; . Hem -ouk prin tin C25, System souks patntin Ce System-out-potovin C495 4 L 0 60 Joo petesit 1so Scanned with CamScanner 2p a te = oe oe eer eet Ape eee faginonl wal Aagumenk Wy. @ in eae ere nit iis Halaibable-len temple ee Ie also nok posible thenwe get compile time _eF0x, 4 dine g-byte = 4.0 byle 3c byre tek Coc >) 3 Ant jong Floak double. — a eee | widening | uaidening Lp SL | Davrou?, 24 ik. ———— idenin re ees Maled as wale ge 4st Scanned with CamScanner oo x. : Example. 2 = “widening cil =rT e. Class Pa. b t Public static Noid test Ccloublea9 ; a g ~ Sy siemn.out+ pai nln (Sdaied3 B t it oul-printin C* long cD aie ae fii ratte void tse main (54sng<-9 4ogs) a fest Cec?) 5 fe 4 E 4 output 1299 Scanned with CamScanner ats = b oe * | Method Recunsfon_ fon f= method £5 ¢ calling Gh calf bors [95 known at mebind weeuccfone ox | procets of executing. Same Salman nepeakedyy TEER fetta aie Mielte er aneforss COMMON La teed | Rerunsive call Shatement $= the statement whieh % Peeing eee enor Scanned with CamScanner S| iets ~ | = ees | mainO =] Lt = Fe s.0.0 oni) = Sheela — a [Fg Syerraie CHi3 : - | ee ‘ z — | 4 Meltod Area - ; 7 aloe ‘Syshern sou: Pritt | Gy ary ee : = ; binipied bok a a Teyamul piano) af Sheela OS I_s - aa 3 fu [main ©)? Calling shapreok- tack. Area” outpuls ya Hi Hi ti Hi Hi Hi Scanned with CamScanner (Pron [om ° ° ic ynon- ! (% state Method 2) non-stabic_methiod | fe 3 non- sialic Block, fe TnPefalt: 4 Skiali : C518) “CEIB) i i] i * exomple 3— class Pa. 3 : [Global Area Static Int a = 105 Dae J Vamable Pubite static void Savita CD v [Merod | - % J ay ee “Scanned with CamScanner ae agholren 2 Saturday == ae 4. Global Memboxd t= iene — +; embers declared Inside_globa | Arca_ane known os | Gitnbal_ members a #|_Siolf ae 5 as Any menbeas declaoed ‘inside global Aaca_prelict with Sialic keyuiond $s known as Slalie—member-———— ¥. tatic Variable t= fable_paetizd with Static eey word Fc knoion as_siatic Veafable- : aE I \ 2X Slalfc Melhed $= = An lared inside Global Arca Prefixd with _Shalic keyword fe known as slalic_mettod + “exomplés- class Po 7 | D \ palte fata |! Global variable (Global variable have default P | public static yoid main (Sasing cI ongs) System-oukprintin(ays | 3 | oulpul f- 0 Nok 2- Global variable have clefalt value. thal 15 way Qlobal_yortable can declared without | TEriicHen Tniviatization. ) bist nitalls = Scanned with CamScanner NS —F Diinince Betsneen Local daniabie Pd Gisnllae.— Baga to. Ome La ose Vortable Q\obal_vorfable > the vanfabsle decleard Insise | Global Aaca fs known cd. TT faside. bocal firea ? - Gi\cbal_Vantable . | _\mownas Local vaniahle st 2) m2 <3 Sutil TT dectenerd ufthou cleovd ii viouk Ini Hializalion Tnivialization @l total vanfahle don't —_|I<2_ global vaniable eo have default Value. TD. local vodtabe desleoad —|[L4) global_vantable decleaxd | §in_Local_Aaca_only. 0 Global Maca asuell cos Noo Bata lé \ voc Mi Jord fnside slack tore Wnside class shetic | Area. Aaa # Fotenal voniabie_] §ot = 0 double = 0-0. | Coat = 0-0 Shing = Null a chav = empty Scanned with CamScanner ~_fowoample!-_cioss. Pa | static tnt sl! Global Variable have defadt value. | © restated man (String 3 ange) — — diagrammatic representing ——_[-dlobal vviobie_\ ig { : : = | |"Tee f- ty a me tie ai - To a eae a . mainc) fe | A 7 Clase static Arca - : ; = - 2 i, I rT] D || Method Area | 7 } | | i—q S-0-Pin (a)5 Al Slack Area la +g L Durpul =~ O ( fot > default vane % 0 _ Scanned with CamScanner (2 Any_matined_dechcad Saside global Azea_oretixd with exami class PA 4 < a sanz Sata / Global variable / static Veviable. i ic Voi i ing C bangs labic Context 1 Sioa) | Tae | Class Static Ave Metiod Area Fe enod block GR : shah 3 maine) 2 Stabe |Conkey Stack Aree Scanned with CamScanner a || ered | 1 il anklet same name — OL | con we comle Local_ani | given 40 local. Vanicible- — Nes jable. then we must a | ——) Alwnys-bigh-psority | Considend_olass name. | Syntax t=. class Name.+ vaniable.n I “exams class Ps | statie Sot a= 2D Global nai La aaue [ Stahic Context le a 10s I Local variable. | System -oul-println Cas Syste coul-println (P44) $ Ji class Name - variablenames q/- =) po / pha Haass (03) [Fret [alia a | ; ry ae — Eh =) peated far geo static Tees Chass static Aree ro) i Sa eta eral| tere, ddoess| __| R fnka= 03 | — ~ Melted free 7 : S0-Piacaas Cone t 5 eee i main ()3 Stavic conte t meted block Sind end Scanned with CamScanner |_ciass Pa. Ig | rac A : Gyckem ouk-printin C®wetcome tn Instraqram ™) 5 $—_—___ cE System out printin CY Enter Username ™) 5 System out paintn (% Enieor pas word "D5 4, — i static —s = : _pintin C“ from Coy os i ea ~<] > Bee! =) <=] 4 al Xr Nth Welcome to Inshag ream from meta Entey Username Enter Password EY ~~ Scanned with CamBeanner ° yr? ¥ by using Slatic block For. example :— class Fia cms = 7 Stale eh t Syeiem ‘out-printin (Static Bloc”) 5 Hest Od 5 If metrod calling Statement 2 . os pubic steric void main (String C3 args’) e System: out: pintin (“main Begins”); System -ouk- printin CS main ends?) 5 3 Public Static void fest CD 4 CT System -ouk- prin Ctupese mernod ”)5 2: = Dutput ¢- Static Block Tesk method main Begin main ends. Scanned with CamScanner age Ne malate, | 100 107 ——T . —] Fig | [name address 4 —| i clas Static Avreq Wy | Lt Heap God) ot) —-— Address [. | 3 ee 1 nen — & Susterm-our spinnin 1 zg % Cimain a5} ] manty +t anim enastt ano Metnod Area . | leceaass reco Pr L “4 “Gre moms FED. | z Sysremeut:printla {I | Grarie weet teak OS, i Static block Gack Arca utput = Static Block Test-_metnod t Main Begins main ends Scanned with CamScanner wo numbers lergest-of = largest of four pumbend - Cisse |orgest Nuss | 2 Pubtic static int largest: Cinta, int b> £ if Carb) 3 Telurn a5 4 else. Telurn b 5 : aed t 3s Public static ink javgest Cinta, intb3 mre) ae 1& (Corb §3boc) a0 i s oetunna 5, 4 else if (b>c $ ackurn b 5 zn 5 else Agents 4 Scanned with CamScanner iy Public static int langesh Cinta, intby inte jatd ) g ie _Combagboe Sherdy 5 ° oelunn as sq aise 16 Ch>c) Sretunn b} % ese ifs Coad) fat i= lavges) (10,20) $ ysem.oul: priatin Cid § jot m = largest (10)20,3093 System-oub-prinkn CM) 5 jot n= largest (10, 20,30, yo) System. put. priatin (5 4 ef Scanned with CamScanner is aneaee | in ping CJ aaqs a. Comer), : : Si Out print Cad 5 intin Ctme”): sie Scanned with CamScanner — Lprintin C'sra-2™) 5 = sI6o- “Sheela B Nu) False Sheela E mse Sheela B Jeela _ Taue SheelaE ela True! ME Scanned with CamScanner Pepe No. block ae } ae ee Class Slat Arca — Neela pame—Paddress—}—afited—b ra Sees t seo Shing boolean | LAR Syrem-o printin(sheetep'] | Systeme pian (a3 Sysvem-0:pri atin Ub>s a=" |eela”5 b= teues | Syste o.p et ovi0 (sheath —t maint) Sheela) Sheela) > Sane COMert eo) 3 f Spkmo printin(*B")5 Addoas |) set a SD) Sheelatds eS (aa |i (naee Sysvm-o.printn (a)5 l] Sisvem-o-painhin (BI Melwod Area || System:e: ppiahin «Mey } Main Cy > Static conker | TE S gine out prinnin Coshetdh Output Sysram.008 Previn Lad 5 SIBA leela System.oul -printin (b23 SI8% | Twe | A= “leelars GheelaB ME bz true; Rul | Siem: prinn oneal iq false | Shee > Sian’ cake Sheela fe | Syn cn pCO MB. Sheela V5 4 SheelaB | Staite bieck = = \eela T Sysiemoud Ponte SRS Tove Static block 1 SheelaE Scanned with CamScanner AVVA\\\\ Se \ai $ © Syston out-printin C'9sp 8%) 5 Systena-out paintin (493 _Syshemn-out: Println (b)5 Q=1055 b= Lars ystem-out: prinHn C*gspe ”) 5 Public Skatic vold tsp C) th = =< v Sysiem-out -printin C" Isp 8") 3 Os 1s-53 | beth? ys out: print Cad 5 stern: out printin Cb); LiLLLLY | | ! QsPpc)s _.Sys\em- out: paiolin C“ Tsp 6") 5 4 J da hic Systern-out:printin C" ST6-4™) 5 gspO3 = Scanned with CamScanner —publte stalie vaid main. (Sping £ 1-aag<)———* x ahd BL 'yskem-out- prinkln Ceme")5 isP (ot . fnt a= 53 souk. prinHin (Task2.-.a) 5 System-out. printin (295 System-out -peintin Cb); yy sktm: uk pointln C8 ME”) $ = Static tv System: out printin ("518-2") s q al om Qubpulsl STA + los Aspe aot 0:0 a = ME aspe ST@-2. mB T5P.B 1S Se 95° 8 15s gsPE SSPE Scanned with CamScanner [ask Page No, [oate Class Static Avea —_ 183+ _}0s F S.0- PCH asPands Name fed] a $0. p Cars Read maint) [10°]. ‘ Chee OF loss Stary 2 2 +0: ein C ISP E™)> | 4 GSPCOD F Sravie Conner Z5.0- P CM35PB")S ©) > Sranc conven Z Sunn on pan MODS ISPODS, razS; arm oar pHa Take boa) 3 pains 4 malndy 3 Static Convent { Sysven.out penn (530.2) Sraticbleck 2 J Sajstern-out-priatin( 4s? B”) System: out - PrinHin(ay 5 System. out print (65 azlos 5 ae & i System: out.priatin (“SP e') —— Stake bicek SPO) 4 msratic rex b USysierp guy nine (sre Static block! Stack Aven Scanned with CamScanner & Static Meltrod + Any methied ceclared | tL | dittenence belweer Sialic Mellod And Slalic block. Static block | + Any Snside Gil inside Glohal Arca _peclixed tutth stati 2. known ac Slatic Mel tad jt Static method have name, femal Argumeniy mn Formal Arequment, wnd_Prefurn type data. * block execute divecthy b+ metind gol e: coube Sn stack Acca ftp nitis coll « block {big execute 2 Static method execute, Bofnre main meHrod | after main mevnod but only one 7 | | Scanned with CamScanner \ | | Non = Staticmembens.¢ ic 7 t= dst laniable nok prefivd vit a Scespunond fs known ar Non= Static Variable. i ! HE \\ = * One A inst non= Gtalic method \\, non- Sialic method Non= Static ‘block = any blac Aecleard Inside gional Reta not Paetivd with slatte be yusoaed Ys_known at it \ Tnshance Initializes” Broce ___— | | Nonzstaliememberrs| [| @ non -stabic yaniable . @_non- stele melnod ‘ @ non - shalic block / —___| erence. Lnitializer Block | / Scanned with CamScanner | ic J = Stalic Variable Dilfenenee hekween slate Variable and snon=stal’e Naniable. ~ Non-staHe Vorlabie | . oo ) nsi. 7 é ned uitth sialic Kepuond Gs Stalic Yaaiable.. Ts Kuown of non-Shabic Kesiserd Voniable. 2 Stalic Vanioble have. Same memory for + 2) lon sialic Vaniable- wit object. Stalic vaniable ane toved Inside class talic Acca hase _differenk memony : A Objed- D non- static Variable _ ane Slored Pnside. Obseck - D sate Vaniable will 4 non~Sstatfc Vaniable hove 3 ways to execute i Tt is only wax way +o ) Directly f Cxecuke emt pot classname. I) Obsect Reference ‘D> object Reference. 3D) static varioble have aide : classname eef = new Ces nan Cref a 5) non - Static Variable have Objeck_creationis not 7 Objecl Creation ts= mandato: mandatory . =. dato Scanned with CamScanner

You might also like