Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
20 views
Java
java programmjng Language notes
Uploaded by
B Tarana
AI-enhanced title
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
Download now
Download
Save java For Later
Download
Save
Save java For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
20 views
Java
java programmjng Language notes
Uploaded by
B Tarana
AI-enhanced title
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
Download now
Download
Save java For Later
Carousel Previous
Carousel Next
Save
Save java For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 54
Search
Fullscreen
oVerricling, oo Feper Chey Hh, “mn they aye We have fo Prope hae Ke dot Dberaboy SA Kepearel are Tf reher, Aype 72 Primitive Pen beth wetheds puget fare Mae rate ; rinibive Hey Lad, Chaty rrched Cary be Y vehom type 2 non. 2 i fame yebury type Or chem Aype af tub let} rched ley the Sub clot cof te vehom Aype He Caper chess motel, Toy Feghne 4 Led 9 lomvarviint Meloy Mee. This a . heating 2) radacced 0 FtKSae Clety Shape’ § 3 cles tuncle erbendls Shale 4 A] Cay If | Shape wil Jd , reho,, ree theypal J. chy Be rlends 0Y Reckegly mil Ue \1 ; rehom reo Rehan lel). |, S. veldbion of Luper b fab. ¥ nape A 5 Ce mebbod Putte greaky or —geat bo Scope Ob Super Chet treble, chy al ae ‘ Public Vaid mil) F } w Cla G exkndy ny Sie Grj}I Overrile td, 4 Void Imi 43 b Spe closg, gt We lam Werrice a Shbe melted wll A ptatrg mre Kad only. GF ve lon verre a Sgtapce pelted + 5 CLC Inobhecy are Lidde,, Nn - Cobre relady ane IL x Lh IM Supeytly veethed cbey yf ct . aed ‘ 4 Lubchy dvewuddiy aye Lephon, -— mebol @ bel sP Gee declore Chk a elas the Chechead Cxvep# =fpate | UnitNo. [Lecture No, ar, wwe Faculty [Subject Name | Subject Goae | Wain Topice™ Page no. ir x te papertliti meted decor) an e nlephion '- Sb cle wreridiling method fa, dechre Sarre, Subtle extepFio by no exception but leon deglare Parent exception I. Conphructrd Gnnot be vvewudde, lorsSrictors yley!- b : 7 trom fuper 7? Lub, |. Conpbuchr* lollny Ort #9 : 2 Super rst be athe din’ selene ae tt feel wi : / * ee TUL the tostrecbrt Of Sub ts “toll all bass anyment Contructer ef Super Lluss ib nef default ZeroUsing a new keyword Using newlnstance() method of java.lang.Class class Using newinstance() method of Constructor class Using Object Deserialization Using Object Cloning - clone () methodSteen -Stemoptecemnes ’ suppresetarnings ("unused") public statie void min(String() args) throws Reception ( {/A.cxeate an object using new keyword MyClass object = new MyClass0); {/2.czaste an object using refiaction Yoclass object? = ObyClass) Class. forNane("xSEEOETEERSATSEEY ) neyinstance() //2.cxeate an object using clone MyClass ayClass = new MyClass (07 MyClass ebject3 = Glyclass) myClass.clone() ; [A.czeste an object using Classioader Object cbjecté = MyClass. class getClassLoader() -loadClass("kkjavatutorials.con. MyClass") {15.llee the Constructor class frm the jave.lang. reflect Glatsctyclass> classi = Myclass.class; Construator> constructor = classi.getDeclaredConstrustors() (0); MyClass objectS = (Class) constructor.newInstance(); newinsts@ an Object using ClassLoader Object abject = MyClass. clazs.getClassLoadar().loadClags ("kxjavatutorials.com MyClass") -newinstance(); (inte te ors ae See aa ccarmetcntner 113 acter er ment pears /16.create Object using Serialization process Create object using Desorialization*/ ObjectOvtputstrean objectoutputstream = nul; ey t Fiieoutputstrean £tleoutputstream * now Fileoutputstrean ("ekjave txt"): objectOutputstrean = new Objectoutputstrean (fi leOutputstresm) Sbjectoutputstream writedbject(ebjectd) ; //rise object eo sila objectOutputStream.flush() ) catch (Exception e) peintstack?race() vesnaityt Le (@bjectoutputstrenm t= nll) ‘objectoutputstream.close(); Objectinputstream objectInputstream = null; ty t ‘cbjeotInputStream = now Object InputStream (new FileInputStream("Wkjava.txt”)); MyClass objects = (uyClacs) objectinputseream read0oject 0)? System. ou" -prantin object. tostring()) | ) catch (Exception ) { ‘printStackTrace ()1/3.se the Constructor class from the java.lang.reflect 7 ClasetyClace> class] = MyClaes.class; Constructor> constructor = olasei.getDeclaredConstrustors () (0)? Myclass objectS = (fyclass) constructor.newinstance (); [A6.create Object using Serialization proces Greate abject using Deserialization < cojectoutputstcenn ebjectoveputitean = 2411; ty t FLleoutputstream £1e0utputstream = now Fileoutputstrean("kk}ava. txt"): = new Objectoutputstrean(£i1e0utputstream) * ‘bjectoutputstrean ‘ebjectOutputstrean.vritedbject (object é) ; //writs object to rile See eno ) catch (Exception «) ( ‘euprintstacktrace () Veinaily( Ts (ebgestoutputstream 1= nu11) ‘sbjectOutputstrens. close () : ObjectInputstrean object InputStream = mull;‘objectoutputstream. writeObject (object4) ; //write object to file 2 catch” Exception printsteckTa0e() veinaiiyt Ef (cbjectOutputstream t= null) ebjectOutputstrean.close() ; ObjectInputstrean objectinputstream = null; ey ( (SHEERS = nev oeigotrnptstraan new Peseznputsteean ("2:50 wyciass object6 = (HyChass) sbjeotInputstrenm.read2bject(); System, our-printin (abject. tostring)) : ) catch. (Exoeption «) t DrintstakTraoe() desnaiiyt {e (ebjecttaputstreaa '= mutt) ‘bjectInputstrea.close() : &5) Can you define class? It is entity having properties and operations where properties means variables and operations means methods : 1 EI a6) Can you define Object? - it's a instance of class. we create object in java by using new operator.all members of a class reached into the memory . we use new operator to create object PY fe]4) Is String datatype? No its a in-built class in java its in java.lang.* package it has methods like length etc. KE PPT susscrsco WY8) What is difference between global and local variable? tell me any 3 to 4 differences global - > outside of a method => accessible across a class -> intialized with default values -> we can apply access sp. static to a gloabal variables --> local variable loads on heap Local - > inside method ->accessible with in a method --> We have to initialized variables --> local variable loads on stack Ec wT10) What is block in java? What is its syntax? When is it getting executed? static non static synchronized // your goes here --> whenever we load class in } memory that time static block will get executed and non static block will get executed before a constructor. Pi ssscasc BY11) What is super class of all classes in java? Object it is stored in java.lang package -- it has methods like toSTring(),clone , hashcode,getclass etc. Pi ssscac BY16) Ca you elaborate protected access specifier in java? (Peabinding of data into a singlelentity.by default iin java we get encapsulation. proper encapsulation can be achieved by using private global variables and accessing those varibles through getters and setters PPT susscrisco WY18) Why global variables are recommended to be private? if you make private no one can call those directly and assing invalid values.. we should be accesing it through one method so that we can add some validation if needed, a EI a> to change methods > to reuse features > to add some additional we use inheritance ve EXITS @30) Explain this keyword and its syntax? this.a -- global variable this.m1() this(); - first line! ve EXD @Mii 5 OnlinetDE~ —FreeMock~ — Evert seater Q 2. Why is Java not a pure object oriented language? ava supports primitive data types byte, boolean, char, short, it, float, long, and double and henceit snot a pure object oriented language. 3. Difference between Heap and Stack Memory in java. And how java utilizes this. Stack memory is the portion of memory that was assigned to every individual program, And it was fixed. On the other hand, Heap memory is the portion that was not allocated to the java program but it will be available for use by the java program when itis required, mostly during the runtime of the program. Java Utilizes this memory as - b ‘+ When we write a java program then all the variables, methods, etc are stored in the stack memory. ‘+ And when we create any object in the java program then that object was created in the heap memory. And it was referenced from the stack memory, Example- Consider the below java program: lass Main public void printArraytint] array) fortint i: array) ‘System out print 1 ‘public static void main(String ares { Int) aay = new int! 10}, rinvarray(areayl 1 1 & cael atyourintervewwithMatercasses_tnowMre= For thisjovaproeran. The stack and heap memory occupled by avai aeRO Sais EEOnline DE ~ —FreeMock © — Event seater Q Now for the question: Is java a completely object-oriented programming language? We can say that - Java snot a pure object oriented programming language. because it has direct access to primitive data types. And these primitive data types don't directly belong tothe! 's direct access to primiti /pes. And these primitive data types Joteger classes. 5. How is Java different from C++? + C++ isonlya compiled language, whereas Java is compiled as well as an interpreted language. + Java programs are machine-independent whereas a c++ program can run only inthe machine in which itis compiled # C++ allows users to use pointers in the program. Whereas java doesn't allow it. Java internally uses pointers. C++ supports the concept of Multiple inheritances whereas J4¥a doesn't support this. Andit is due to avoiding the compleity of name ambiguity that causes the diamond problem. 6. Pointers are used in C/C++. Why does Java not make use of pointers? Pointers are quite complicated and unsafe to use by beginner programmers, Java focuses on code simply and the usage of pointers can makeit challenging, Pointer utilization can also cause potential errors, Moreover, security also ‘compromised if pointers are used because the users can directly access memory with the help of pointers. by nat ineluding pointers in Java. Moreover, the usage of pointers can make the procedure of akes use of references as these cannot be manipulated, unlike pointers Thus, a certain level of abstraction is furnished ‘garbage collection quite slow and erroneous. Java m: riable? 7. What do you understand by an instance variable and a local vat Instance variables are those variables that are ‘accessible by all the methods in the class. They are declared outside the methods and inside tN, class. These variables describe the properties of an object and remain «QP Excel at your interview with Masterclasses al cath - ed ae oae0 Ang You ME) Core a ntewew Questor x) op. Cel) Con have mere the, Ore Loma Luk ip args difperer A - tA _eybet Come _Overbacday. Olen be GH gre tet fromm Gach. Cory | ee Yer We tom by Creabing hy BY the Cord = ke bg tting — Pha tortor which 72 agurtntel Y A by Colling bugerl) & this lL) ote do fer RE we oo oo x ez 5 ae aa go Bo Re Ba Re Ba Ro Ro Ro Be Ba es e4 a zo aoae we ee " gare orett February 2022 sateen 15 tucsaay” NAME OF “a F cover | —s child on B cbyectly sire, fa. - 2078 | re RT te fe 1443, Ta 13 case | NEXTtx Uplerpace velral 4 huhy Mone ° “trys” WV nbe 4 ffalie firel by dopaulé pl Sheed =1%, Juve vated Pode FIP). at 0," ic - buck Sted en ots, jp Adlic j abshuc dofeol! we'd Cobia Koy, Clu buxtomer Ln ements vetial f pesle voiel sankcJ{ S07 [i gtant) 2 edad Kay 2 Bren Choe Public vor Gort) € S-0 2 Cignt ) Cet keg "ds ° y Saye Public Sabre void Path (shingld cy )f sto 1): Pash { a cee Gaboment), 6+ blow Hof): e024 bel ei BC. patel) 7 C. sopl, yoke woceld I, Re ues Pil ca. 4 Tiberitince, ‘- When one (led GtceH Me froperty of bnbher| © Mok: yjerlendly) Heya ty used be bertform sake iD LI Provids Cocke reudability oe Le Cin LCM Prive renter Ph Clin $h GH sup Ghats totus AU Me teghes of ne ow" Le Ghoul! ~tyeale He bes ch bub thy ee / “eer a crty Podsible Hhrouyh a; ber hoe Il Sader Lhety a Ct Sendy Me” (1 $0 Le »lS) Cow Cxlend> dorien! { “/ yh Void pia IS S-OxF (p20? Jy pat) Gof (gr cabing Ii 4 Wiel fs Ces Clay) A esvr ls pay de reer Boal) eeu ae nas yy d Sound Jy dd CH 73 CSB tend 02 5 C E43 yd Gxlg abaructt Jolea face -— just Like 4 Chun ihc» Comber bg hep method. To achive aplerface & gare Lone ej [Anfer fect Megeore Woke :- a by Alofes. aspadhs are Pb shabic+ final Lope O- enteaface © by Dofeull melhoty ae Able tot abyleec @ From ToK fer Oh wares Atenface Com have dafaulh 4 stob'c _racthaty Questions & Sungary=————<——————— Main Ideas, Library Ref:-Che 52. hextlntl 7; Serie (0) 1 Caseys b. Deposite 14> preaky Ce eee , brcack Aefuul! : §v.p C Faukid Choice" J: a Y Kod, Teun ve Gn eehiere ubstruction, fo bes, oOo tI 4 cebsonc thn (CO -10 4 TSey fee (oor J % abst Clon yp Ls an ; 7 ene abShact melhor alle! aa ® Chadd Corbuth be bh absteud chy, Coeele Obfce! & for abshut £ pet Be Plenty artim, ase f lee none abstract chu AT Contain» bath von abgbract metrat Binge the ahle 44 Fammon differs. s pha, we Should + abshuct meth el cy ehess Whshacd ery av bel 4 oil begs 6? £ 60? (all Aaninaly have 4 logs", abfl ved oid Foti (J, crag whl Cal 6), i)aed 6 Peal Hie A - Cappele + rubieiren ef di G pag - Cortes fen, teatit aie cers ucapscleb io yg a wechanwem OL LL, late member Cod », YC Gan btrelrng fle webbods 3 a EX Clears Bayle 4 Pre vele del y Pervde Pwel' | l ’ Nok: fer webive encaptalalin depo stk! 75° (0 clecda variable a4 Prival Mdlic- eeiteloau( ), @ provide Prblic wbker & shy LL cheek ICY : de Show OH { rot Grou Aleve! Faplins dal”! 3 9g ex - Ferd. ere mad oe) Phstrachs - hiner, LHe Ee Cabral tfOrmation, tnd pighhight the Ordg gel CL sources Sdocys aof have body 4 a. Abstact Clon gy eer Dry, b “b Slade t Clay) Beapts Abbe Striny Ww the ZESe- " " Dublic string DISC "My OarK KS 5 Mage Py Books Public vor Lanls_ Sekt!) hel ep [Bick Mame: 4 Manes Gan LFSC Cocke, AEF| Syntax clay P tA Cnt o> pong) fi 4 a éx Gla Aa NO LX, gy ALA a, wetbd _* ay gh} Vote! Show) ne rl xe Mey h: Copy SND Crdtruclor - . Clas Bf teleneve? We He Conrrtyucter Aber, it 9 Called ae - yi) 0s erate vO? hag ier wo v- ides » Show Ody 5 + OUP ace 100 geferenee 40 Coyrucber pun objet lod cog He dala tf Gnbleer Suntan: Clays P Lp Coy vt) { 3) 3 cy Of . ¢ oe Ushio? ay) pore vey Os aye mew ADs 3 OW ve jo Leame tewwBee Abe all kent 4 ore W Pays eet Greg Coyruter fest) if Cobo _ a oo paodier Objtliag,. TR re PoornMA bel, - Chjet | # anode 7 . help ob Qefrunce reves - se | Unit No. — Fecuty —] Subject Name | Subject Coae | Main TOPICS” aa Ppivele ComHoudlor tn foun, if 10 peyible te peute 2c Gnd wa | Dn : “as 4 Qivell ad a Private bul accord’a fe th gull @ we ot dccen Prior merbee Spreader: Clays Clest Name cussiale © ches Posvelt Clan-Verel J g j s Ela) 0 Uns 4 Syter, doubl by {pV eere hut rosin beclhera! wrtel Siale chess Pyivake WL IS cist { ate, b7 356 Laser l(shagel werly solar Mabis 2 4 ye, | pup osvrnlsbrsls os) every a L ax ene BOs tow! atte ble Lortlous 419 nie whe - 2 Vie lO 30-56 vl gy Supter Koy word -» Super key word weperd do Me chjeda bh Sup. Clays : ye Ss ud Ghar We tad to call the Supes Clas) Overs > melhod 4 Cow sbuchr trough Sub Clas? Object. Main Ideas, Questions & Summary: tilt Yethod fri? pith the fol oh Clays ene Ex A tuglertadele L Sub Chew! Woe 5) whenever th Sete cuss & . ae Ard ynehhed nace both gene Fane Bica pe" ME leseel On fy. erred the Lorcfusion blu hPea Clary ancl Feb chy a me Ord methety thal hare Gene Vere GE whl Lose Piper Kewe ad Supe ~ > Oi Vetinbt 3 Cw relsed OW Conghucteo Cr cloy Sfrudeux ce) 5 Class 8 |) Supper Clow (is 6 erbndlo £ gb ade” 1g, a, £ ee) valet Jhowt) i « 7 A $0 eles, £0. (Saf 1 : 2 } clan & extends Wd Cher) meth | . : esvm (sera) J 4 a ae Bore nee’ 0OR t? : . ‘ 2 re Show (), supers 3 ; — fe 20 10 x fe 7 dt CH eto t ) rellaa fj beep Shout J | ( Seo 2" ly, © SS rs ot Cwd a b() | boel4 a ° 4g puter ( 5 Cay debanlt clan pares So. ¢ U'HMORLS oysv OK 5 > 9 renew OOF roe «ok Lay Pang egy mide OF 3, ote D.a-rew Ol I 8 j 1? trphle H Hello 9 . wel > Gn [hia_yeroste eee Git, Objet toile @ -S h. x A. an pr a fk: oa nev al); a Main Ideas, Questions & Summary: . a ETS peta awh Clas) Chile e entire Library Ref:-} ei ex L ads Fy vere Show J Clay) * : = { b.0 p CHI SF (Caley psveten Er Pseml)* My (unt Nhogal ver {ners new at, [flo = 45° SOP lr), (fe Hep 33 > Shows J, 4 Se. . P @rariigtd a, 2s no. nO rasan OP ze cat vatiabl lia wherever py pen ee aol do Ae both 2% Sane ble pun ceoniater Bhd Leonfuded! ~ otc! pty: abedd phy Problem We Chole wade Haz ee (Sx CD then we tamt Ae Cell Pee clefahelt Gonvtuclor of sh cn Clty Zh in uge “Chey AE uw TF elly Cle! farensbr iB re? Be i Grypuchr of eee re S00 LHe 2"). ; Ex Class AL ACGA as L fey Ty Hin tieyy SO" Cu), 5 p 5 f ACLs alt Poymie) wt 0.7 (4), Age new Aloe), 4 0.7? lH), , Psemcls [ello : ) me a= hew Al dy oo / 4d ug phone rare ol? ho 6 100 only ]abs: - = — os tiny Copies oh tH Aitance Mmeber varie, | = , Gy paae pucanber of Chjecls Je Ling ob new will provide Mee B7G whi : vole 190 a oat Stabic meober vuriuble) 4. The will be poly ore Loh a blebie wreerber MeV abl intespecbive gy tmmber Of Defects. 2. This Copy Will be Shared by al He objects 3 dum will Provide memory whik Soncling the thus | default volute ys 2 y S Gon be éecerted through Clin nome dy Shr ough Objee!, 6 ebro Keyuord «9 “heel aan ' XO =) global variable & Tous whi gute) Ma 0 C a ee n° Iblanee member variable pen uty thle member rurioble Hon eit) ee a Bel BG nes fe ie : In A remnte, eda , 0-PLL) no d - : 3 (nrhince /$tcbi J COME we) CUninhrl, Oe Beal_/ tn » _— felt Class pret Osvrml—) £ papenes al J; 8 42> new Aldy “An rl); Bead! RU A-bd a x —
Q) dum wll L@renry — load Lasse { tng Fj£@ rengry Glstit “ind 4, LO Memory eo § re Si biaaling bio ; bai Oo ax 25; | malts So PU Helle”), Glled by new twhih dleky Greahing objecks orbs Cll dimes there MD 0. of Obyects Halve Upek Cle by , Ter lokile Heodig dhe ef One onge a - LOqy WY Locecl Chav) Pest iy ; Burt{_) © ee says, a“ Ws=new Al) 4 [cy @ & ¢ Foytes : Bes) oy Peay = mew Al). ted] Pp MN? Sicaee ance 3 one[pate [_UnitNo. [Lecture No,| Faculty [Subject Name | Subject Gode | Main Topics: Page no. \. Wwe have to Coble? revouclly £9 tolled atomabidally udmg clays nacre lohen Tem toull load the Chiys Q- be tan toll iF Main tre! tT A jn Mel Orkg Dred aguh at de we Yde Shabic, ZL Clave} cz clea nf P-Syre_ot Aublic Yebrc void rain ls— yf $.0.€ LU Bye"), 5 7 3 | Seadeeg : . 6-0.P ("Hello"), C3 etary > Javed 5? ae Oe ae ame ord Jum will aulorali ofP> elle aol main) Marough Hig: Clash Rye ae aint J rout be abi mh phe y $0.0 C Mats. pols, 3}, - P $0. a Sol Mat.evwlt, a) Cu neve ) vs. Limes Cobhe memba Collec! by ers nee) $0.0 (Powl%)s fork ibis aeralang-| im P (Powt5, 2) ),: T [Run @0 Lord not 09 % Wain ideas, Questions & Summaryw wo ie Spteeoed prog ee ") Je oe ae fort Stab dave dang basher} ; Sytem ouh toipg( Hi"), 7 . Lub. Print (" Hello’). DUE Bit" Wi"), 8? Times po , Se dey he) ingle tom Clea (There ioc} 5 ee Only ane cop Apsting member just file sobic rember Jf er_ pad 72 ° Cluse [ Payyake Leake A Oby = null , “Gaon pele CPZ darn 2 ahh bay pte Al ae pale. nefae A SAetie retoea B) 4 ae af + Po we 0 aD DE dt Stebic & gebdbjectt NE Bae etage gaan #4 Coby = veedl} MOP Objet a a7 Ob5 = new Al, 3 achrn by’ clo West 0 Svm(—}4 IO ale new Al Jy 0 are. geboujeot (). ® a= A. wobject! J, OP Oby = mult; Sytem. ot Prltbln (a= 2 aa}. |] Prue ie 3Unit No [Lecture No.] Faculty Subject Name | Subject Gode | Main Toples:- Paes 2 The Lingleton's Purpox ih 40 Cyyol CWjeck Cveghons Mmiiding He mo Y 0b. Ww one only. Line fer 44 OY One Linghtn Ashince, ang sahagte tields ef 4 Figghtn el prawm rly once fer Clap, Sushibte tell singletons Offer pba accey 4» resource) Such 2 ditibese loom echions co ferekels or, Af You hewe a _licemge tr Only ane lobtinedlio» bf por your detubese or your Ta0C dwien fd froubk whhiteercding te fingkton makes Lure tet Ondg One Sanectit Brack or KS oly tne tyeadl Gn Cte He fmnechor ab abime (lnss 04 Priate OL IE so.pl"Velle’) 5 3 Julie 2 gebobjet (IE i se = hull) * Alas Ob zhew #0), relum ob, 3Frecu fu 0 Fines pis Fird of selbio, / 7 , 7 velebion J 4 elabing f
2 alto calles * Unit No. [Lecture N to] Fac er Faculty az Name | Subject Code | Main Topics:- Page no. yinbitene 13 @ Precets by which Jebine) al poe, ay fh me chiyy bealled 0 Super clo) ) beotpered 2% arother cles blalled 0 bab class witht Changing the paper Clu and addlns new tealered fn fab Chet, ZA 23 algo Glled 4S Locke resthlity ot eves the Progreccrmen's time, Bs “Glass 4 W saver clusy 07 base Clay or Prien! Club 4atD - Wolte 39 faut) PALL eo ned Jecwed iy @ extends PL I ip chen or chill or denivect Lt Y,: I: een daa Keyword Jes 0B Tea 5 | ot eee aad on : 0 ble new BL I. ble = 5G, bly = toy $o.eLbhats"4 sig); 3 ofa j , : yjvi 1 ni R 5 Se eeFfFsS17:03 © oe Beri) QQ @ chatopenai.com/c/5fd7% Showcasing Sensibility in Interviews -+ variable as "volatile," indicating that it should be read and written to directly from main memory, ensuring visibility of changes between threads. 8. Explain the concept of arace Celie Mae ee UR ae * Arace condition occurs when two or more threads access shared data concurrently, leading to unpredictable results. To prevent race conditions, you can use synchronization, locks, or the “volatile* keyword. OMA ia Ruel geese a Oe PUT RUB CRU Tere * The *join()* method is used rod Send a message Ss a ol CVA tele aCe La eltu Eon eke) ao ele) Mol eR LOT LSC laa MSIL Lc a) ATESve ane oe Beri) QQ @ chatopenai.com/c/5fd7% Showcasing Sensibility in Interviews ++ 12. What are thread pools, and why are Rule re * Thread pools are a collection of worker threads that can be reused to execute tasks concurrently. They improve performance by avoiding the overhead of thread creation for each task. 13. What is the purpose of the BCS MCU L SB Lg * The “Executor” framework provides a higher-level abstraction for managing and controlling thread execution. It decouples the task submission from the details of how each task will be executed. v Send a message Ss a ol CVA tele aCe La eltu Eon eke) ao ele) Mol eR LOT LSC laa MSIL Lc a) ATES17:07 © Oe ay QQ @ chatopenai.com/c/5fd7% Showcasing Sensibility in Interviews | -+ Rime ira ee alles cea Uite Re (el eV Ded * Adestructor is a method used to clean up resources when an object is destroyed. Java does not have explicit destructors; it relies on automatic garbage collection. 13. What is composition in OOP, and eee TUN re * Composition is a design principle where a class contains objects of other classes as part of its attributes. It is an alternative to inheritance for reusing code. 14. What is the difference between association, aggregation, and reduces N ke) eat * These are different types of ¥ Send a message Ss Breer eee Ca gto ect eet Mun taeda cen aa eC mmce cise) Versionive ne oe Beri) QQ @ chatopenai.com/c/5fd7% =} _ Showcasing Sensibility in Interviews + BO Ru Pel Ce dl) association, aggregation, and composition in OOP? * These are different types of relationships between classes. Association represents a loosely coupled relationship, aggregation is a stronger form of association, and composition represents a rele Roe Meo 15. Whatis a static method in OOP? * Astatic method belongs to the feral) instance of the class. It can be called using the class name and does not have access to instance- specific data. v Thace OOP interview auactinne caver Send a message Ss a ol CVA tele aCe La eltu Eon eke) ao ele) Mol eR LOT LSC laa MSIL Lc a) ATESSN a ONE an ty nl sO) SNS “ee Life ce of Tread : rohipicabion Zh Fie erpirey 3 DUT gob Trberrughy a “Yebme Qe a23:21 BO eR eke) Q > whystringisimmuta.. & © For example, database username, password are passed as String to get database connection and in socket programming host and port details passed as ae Since String eaiaulicl) om err ie mente MURR eer ea Why String is Immutable in Java? - DigitalOcean MORE RESULTS Why String is immutable in Java interview questions? Why is String immutable in Java? String is Tantaaltiel°) (MLB eR ele ACE) benefits: String pool is possible because String is immutable in Java. It increases security because any hacker can't change its value and it's used for storing sensitive information such as a database username or *K Q al Dir Perea) fot rte51. Why Java Strings are Immutable? The String is immutable, so its value cannot be changed. The String is immutable in Java because of the security, synchronization and concurrency, caching, and class loading. Example::: { String s1 = "java"; s1.concat(" rules"); Yes, $1 still refers to "java" } ered Sed23:40 @O ook 41 Q whatdoyoumeanb.. & @& All Videos Books Images News Map itch OC ee eo CeCe c ie ® PET Pe Java is an open source language, which means that its source code is freely available for anyone to use, modify, and dis. Ebenezer Isaac. PhD, Code Writer 8y. Short answer: Java is open source because it has a version in which you could download its compiler source code. | BAe Re ERE Le What does it mean that Java is an open source language? - Quora OCU Rn Ce Reena People also ask * Q al Dy oN ig Brea) eterna23:40 BO Ree eT nc) COMME are te(R ool eee re ee oth ee tere en a ere | O BeAr ec Rec eR Eee What does it mean that Java is an open source language? - Quora CaCO i Ce eld People also ask Matias CoR ol Musk) Ae) eel cB) BT The term open source refers to any program whose source feel RUC RC aoe use or modification as users mel um ene Unlike proprietary software, open source software is computer software that is developed as a public, open collaboration and made freely available to the public. | Baca me ER What is Open Source and How Does It Work? - TechTarget CS Q al yong leo) fete rata46) What is static keyword in java is a one copy storage. > in this we get latest value for a variables. > static members are called by class name directly > we can not call non static members from static member directly. we need to create a object of a class >static variables also called as class variables. >static methods can not be overriden, as it is class level methods47) Can local variable Pe. be static? No, static members also called as class level members 8888809416 @
You might also like
corejava503
PDF
No ratings yet
corejava503
5 pages
CS3101-3 Programming Language - JAVA: Fall 2004 Sept. 15th
PDF
No ratings yet
CS3101-3 Programming Language - JAVA: Fall 2004 Sept. 15th
68 pages
Java QB
PDF
No ratings yet
Java QB
9 pages
Question Bank With Answers - OOPs Through JAVA - Total 5 Units
PDF
No ratings yet
Question Bank With Answers - OOPs Through JAVA - Total 5 Units
84 pages
MCS 024 JAVA
PDF
No ratings yet
MCS 024 JAVA
18 pages
Java A1
PDF
No ratings yet
Java A1
15 pages
Java Interview Questions
PDF
No ratings yet
Java Interview Questions
57 pages
Object Oriented Assignment Java
PDF
No ratings yet
Object Oriented Assignment Java
5 pages
String Handling PDF
PDF
No ratings yet
String Handling PDF
24 pages
Corejava PDF
PDF
No ratings yet
Corejava PDF
250 pages
oop 2m 4
PDF
No ratings yet
oop 2m 4
2 pages
Java Questions
PDF
No ratings yet
Java Questions
87 pages
CS3101-3 Programming Language - JAVA: Fall 2004 Sept. 15th
PDF
No ratings yet
CS3101-3 Programming Language - JAVA: Fall 2004 Sept. 15th
68 pages
Java Part 1
PDF
No ratings yet
Java Part 1
23 pages
Java
PDF
No ratings yet
Java
25 pages
Object Orientated Programming With Java: Jussi Pohjolainen Tampere University of Applied Sciences
PDF
No ratings yet
Object Orientated Programming With Java: Jussi Pohjolainen Tampere University of Applied Sciences
105 pages
Java Notes
PDF
No ratings yet
Java Notes
7 pages
Most Asked JAVA and Selenium Questions
PDF
No ratings yet
Most Asked JAVA and Selenium Questions
33 pages
Java Faqs
PDF
No ratings yet
Java Faqs
87 pages
It 2 Mark
PDF
No ratings yet
It 2 Mark
20 pages
Unit 1 - Intro To OOP and Java Fundamentals
PDF
No ratings yet
Unit 1 - Intro To OOP and Java Fundamentals
11 pages
Core Java Interview Questions For Freshers
PDF
No ratings yet
Core Java Interview Questions For Freshers
45 pages
Oops I Notes
PDF
No ratings yet
Oops I Notes
76 pages
2 - Classes, Objects - Methods
PDF
No ratings yet
2 - Classes, Objects - Methods
20 pages
503_CA
PDF
No ratings yet
503_CA
41 pages
Core Java Assignment 2
PDF
No ratings yet
Core Java Assignment 2
7 pages
Core Java
PDF
No ratings yet
Core Java
88 pages
Java 2marks Questions With Answer
PDF
No ratings yet
Java 2marks Questions With Answer
19 pages
CS3101-3 Programming Language - JAVA: Fall 2004 Sept. 15th
PDF
No ratings yet
CS3101-3 Programming Language - JAVA: Fall 2004 Sept. 15th
68 pages
Java1 New
PDF
0% (1)
Java1 New
48 pages
JAVA SEM IMPORTANT QUESTIONS
PDF
No ratings yet
JAVA SEM IMPORTANT QUESTIONS
73 pages
Introduction to Java
PDF
No ratings yet
Introduction to Java
85 pages
Java Material-Interview Purpose
PDF
No ratings yet
Java Material-Interview Purpose
90 pages
Assigning Object Reference Variables
PDF
No ratings yet
Assigning Object Reference Variables
10 pages
Classes in Java
PDF
No ratings yet
Classes in Java
9 pages
JAVA Introduction
PDF
No ratings yet
JAVA Introduction
46 pages
Java Unit Test-1
PDF
No ratings yet
Java Unit Test-1
39 pages
Java
PDF
No ratings yet
Java
6 pages
Java Assignment
PDF
No ratings yet
Java Assignment
19 pages
Java FAQS
PDF
No ratings yet
Java FAQS
90 pages
Java Material
PDF
No ratings yet
Java Material
90 pages
JAVA (What is what)
PDF
No ratings yet
JAVA (What is what)
26 pages
For Basic Java Interview Questions 1723574250
PDF
No ratings yet
For Basic Java Interview Questions 1723574250
189 pages
Modern Compiler Design Java Tutorial
PDF
No ratings yet
Modern Compiler Design Java Tutorial
54 pages
Core Java Interview Ques
PDF
No ratings yet
Core Java Interview Ques
3 pages
Java (AutoRecovered)
PDF
No ratings yet
Java (AutoRecovered)
33 pages
JAVAA(entretien)
PDF
No ratings yet
JAVAA(entretien)
11 pages
Class Fundamentals - Final
PDF
No ratings yet
Class Fundamentals - Final
18 pages
Java: Week 6
PDF
No ratings yet
Java: Week 6
14 pages
Hacking APIs Breaking Web Application Programming Interfaces Final
PDF
No ratings yet
Hacking APIs Breaking Web Application Programming Interfaces Final
53 pages
Java Interview
PDF
No ratings yet
Java Interview
9 pages
chavan CH-2
PDF
No ratings yet
chavan CH-2
126 pages
JAVA
PDF
No ratings yet
JAVA
15 pages
Java Labbook Amol - Shinde
PDF
No ratings yet
Java Labbook Amol - Shinde
28 pages
JAVA-1-3
PDF
No ratings yet
JAVA-1-3
44 pages
Assignment No.1: Q1.Explain Java Runtime Environment (JRE) ?
PDF
No ratings yet
Assignment No.1: Q1.Explain Java Runtime Environment (JRE) ?
6 pages