Skip to main content
Open navigation menu
Close suggestions
Search
Search
en
Change Language, English
Upload
Sign in
Sign in
0 ratings
0% found this document useful (0 votes)
4 views
54 pages
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
Save
Save java For Later
Share
0%
0% found this document useful, Mark this document as useful
0%
0% found this document not useful, Mark this document as not useful
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
4 views
54 pages
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
Go to previous items
Download
Save
Save java For Later
Share
0%
0% found this document useful, Mark this document as useful
0%
0% found this document not useful, Mark this document as not useful
Print
Embed
Report
Go to next items
Download
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 [Link] 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 ( {/[Link] an object using new keyword MyClass object = new MyClass0); {/[Link] an object using refiaction Yoclass object? = ObyClass) Class. forNane("xSEEOETEERSATSEEY ) neyinstance() //[Link] an object using clone MyClass ayClass = new MyClass (07 MyClass ebject3 = Glyclass) [Link]() ; [[Link] an object using Classioader Object cbjecté = MyClass. class getClassLoader() -loadClass("[Link]. MyClass") {[Link] the Constructor class frm the [Link]. reflect Glatsctyclass> classi = [Link]; Construator> constructor = [Link]() (0); MyClass objectS = (Class) [Link](); newinsts@ an Object using ClassLoader Object abject = MyClass. [Link]().loadClags ("[Link] MyClass") -newinstance(); (inte te ors ae See aa ccarmetcntner 113 acter er ment pears /[Link] 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 [Link]() ) catch (Exception e) peintstack?race() vesnaityt Le (@bjectoutputstrenm t= nll) ‘[Link](); Objectinputstream objectInputstream = null; ty t ‘cbjeotInputStream = now Object InputStream (new FileInputStream("[Link]”)); MyClass objects = (uyClacs) objectinputseream read0oject 0)? System. ou" -prantin object. tostring()) | ) catch (Exception ) { ‘printStackTrace ()1/[Link] the Constructor class from the [Link] 7 ClasetyClace> class] = [Link]; Constructor> constructor = [Link] () (0)? Myclass objectS = (fyclass) [Link] (); [[Link] Object using Serialization proces Greate abject using Deserialization < cojectoutputstcenn ebjectoveputitean = 2411; ty t FLleoutputstream £1e0utputstream = now Fileoutputstrean("kk}ava. txt"): = new Objectoutputstrean(£i1e0utputstream) * ‘bjectoutputstrean ‘[Link] (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) [Link]() ; 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) ‘[Link]() : &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 [Link] 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 [Link].* 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 [Link] 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 [Link] 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. 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 [Link], 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 [Link]"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 $[Link]"4 sig); 3 ofa j , : yjvi 1 ni R 5 Se eeFfFsS17:03 © oe Beri) QQ @ [Link]/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 @ [Link]/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 @ [Link]/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 @ [Link]/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"; [Link](" 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
Java Tricky Question
PDF
No ratings yet
Java Tricky Question
11 pages
Composition vs Inheritance in Java
PDF
No ratings yet
Composition vs Inheritance in Java
5 pages
Java Programming Concepts Explained
PDF
No ratings yet
Java Programming Concepts Explained
40 pages
Java Notes
PDF
No ratings yet
Java Notes
15 pages
PPL QP Solution
PDF
No ratings yet
PPL QP Solution
39 pages
Java Buzzwords and Type Casting Explained
PDF
No ratings yet
Java Buzzwords and Type Casting Explained
11 pages
Object-Oriented Programming Concepts
PDF
100% (1)
Object-Oriented Programming Concepts
563 pages
Object-Oriented Programming in Java
PDF
No ratings yet
Object-Oriented Programming in Java
53 pages
Object-Oriented Programming Concepts
PDF
No ratings yet
Object-Oriented Programming Concepts
53 pages
Java Programming Fundamentals Guide
PDF
100% (2)
Java Programming Fundamentals Guide
118 pages
Java Programming Concepts and Features
PDF
No ratings yet
Java Programming Concepts and Features
4 pages
Java OOP Concepts and History Explained
PDF
No ratings yet
Java OOP Concepts and History Explained
19 pages
Studentcopy 19ai307 Oop Answerkey
PDF
No ratings yet
Studentcopy 19ai307 Oop Answerkey
61 pages
Types and Packages of Java Libraries
PDF
No ratings yet
Types and Packages of Java Libraries
16 pages
Java Interview Questions for Freshers
PDF
No ratings yet
Java Interview Questions for Freshers
65 pages
Java Questions
PDF
No ratings yet
Java Questions
14 pages
Why Java is Not Purely Object-Oriented
PDF
No ratings yet
Why Java is Not Purely Object-Oriented
41 pages
Java Interview Questions & Concepts
PDF
No ratings yet
Java Interview Questions & Concepts
19 pages
Understanding Java Class Methods
PDF
No ratings yet
Understanding Java Class Methods
10 pages
Java Exception Handling and OOP Concepts
PDF
No ratings yet
Java Exception Handling and OOP Concepts
19 pages
Understanding Java Static Members and Blocks
PDF
No ratings yet
Understanding Java Static Members and Blocks
19 pages
Java Programming Study Material PDF
PDF
No ratings yet
Java Programming Study Material PDF
69 pages
DBATU Java S-22 Solved
PDF
No ratings yet
DBATU Java S-22 Solved
20 pages
Java Concepts and Key Differences
PDF
No ratings yet
Java Concepts and Key Differences
87 pages
Java OOP Concepts and Interview Questions
PDF
No ratings yet
Java OOP Concepts and Interview Questions
24 pages
Core Java Concepts and Differences
PDF
100% (1)
Core Java Concepts and Differences
90 pages
Java Interview Question
PDF
No ratings yet
Java Interview Question
90 pages
Java Object-Oriented Programming Guide
PDF
No ratings yet
Java Object-Oriented Programming Guide
19 pages
Core Java Concepts and Differences
PDF
No ratings yet
Core Java Concepts and Differences
90 pages
Object vs Class in Java Explained
PDF
No ratings yet
Object vs Class in Java Explained
7 pages
Java OOP Concepts and FAQs Guide
PDF
No ratings yet
Java OOP Concepts and FAQs Guide
21 pages
Understanding Java Programming Concepts
PDF
No ratings yet
Understanding Java Programming Concepts
24 pages
115 Java Interview Questions and Answers
PDF
No ratings yet
115 Java Interview Questions and Answers
28 pages
Key Features and Concepts of Java
PDF
No ratings yet
Key Features and Concepts of Java
19 pages
Module 2 QB
PDF
No ratings yet
Module 2 QB
17 pages
Class 10th, All Chapter Revision
PDF
No ratings yet
Class 10th, All Chapter Revision
36 pages
Java Methods and Memory Management Guide
PDF
No ratings yet
Java Methods and Memory Management Guide
3 pages
Java Object-Oriented Programming Basics
PDF
No ratings yet
Java Object-Oriented Programming Basics
17 pages
Java Programming Basics and Concepts
PDF
No ratings yet
Java Programming Basics and Concepts
118 pages
Java Object-Oriented Programming Q&A
PDF
No ratings yet
Java Object-Oriented Programming Q&A
77 pages
Understanding Java Byte-Code Basics
PDF
No ratings yet
Understanding Java Byte-Code Basics
10 pages
OOP Chapter 4
PDF
No ratings yet
OOP Chapter 4
69 pages
Java OOP: Classes, Constructors, Polymorphism
PDF
No ratings yet
Java OOP: Classes, Constructors, Polymorphism
28 pages
Java Programming Concepts Explained
PDF
No ratings yet
Java Programming Concepts Explained
9 pages
Essential Java Interview Questions
PDF
No ratings yet
Essential Java Interview Questions
19 pages
Java Sem Important Questions
PDF
No ratings yet
Java Sem Important Questions
73 pages
Introduction to Java Programming Basics
PDF
No ratings yet
Introduction to Java Programming Basics
85 pages
Java Interview Questions
PDF
No ratings yet
Java Interview Questions
153 pages
Comprehensive Java FAQs Guide
PDF
No ratings yet
Comprehensive Java FAQs Guide
86 pages
V2V Java Super 25 by Rajan Sir Updated
PDF
No ratings yet
V2V Java Super 25 by Rajan Sir Updated
60 pages
Java Basics and OOP Interview Questions
PDF
No ratings yet
Java Basics and OOP Interview Questions
36 pages
Java Answers Mtech
PDF
No ratings yet
Java Answers Mtech
33 pages
006 Garbage Collection&Exception Handling
PDF
No ratings yet
006 Garbage Collection&Exception Handling
6 pages
Core Java Fundamentals Overview
PDF
No ratings yet
Core Java Fundamentals Overview
44 pages
Assignment1 Java
PDF
No ratings yet
Assignment1 Java
27 pages
Java Programming Fundamentals Guide
PDF
100% (1)
Java Programming Fundamentals Guide
118 pages
Key Java Concepts Explained
PDF
0% (1)
Key Java Concepts Explained
26 pages
Essential Java Interview Questions Guide
PDF
No ratings yet
Essential Java Interview Questions Guide
77 pages
Java Interview Questions Overview
PDF
No ratings yet
Java Interview Questions Overview
25 pages