0% found this document useful (0 votes)
31 views11 pages

Java 1and 2

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)
31 views11 pages

Java 1and 2

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/ 11
Jy, \ inka l Jeon oul purinkin (veto) 4 4 Explain VM, TRE, TDK | 2) Ty ighle declared cure hjecks Jae Jaya compiler produ p intermedia code knoinn as | Tinstontisled ond therfore’ they fated ula | bytecode for a machi doe not _exial. “This Machin objecks. Thy duke different values for pach abjee 1s called the Tavo Virtual Machine ‘ond it exists oh id focal Variable ‘= : the computer memory. Th i, the Computer and di computer: The vi |The machine specific code i: generated hu the Tava interprter by ocling 95 on inlermedion beliyeeh th ws firiual machine and the ata! machine « oo —simuloted computer y al Majar funclions ofa ral Thterpieter i differenk fox different Machin |_| sta Ta itu | Prograra Compiler Machine || | Source Code. Butecode fytecnde Zh ell “Tnherortes| _ | eode | Vidal goad Beal Machine TRE ee Tova Qunkine Eoviso one sa laig h ? eae ; 2) Ginnds for Ohjeel Oriented th 3 sare part of the | Pr i rien: ing. Pere Gta ieeiels and regiornming dented Prog. rareing avd It anni 4) Emphasi Fiuncti 4) Divides tne rage inka | multiple funel on ming Tnlerface (AT) + kite with 1 collection = dea | ised % 4 sainni i 5) Madi henitan Sia bauainao El uNnd Miendan aenevek atten aThey_include £ Vs |_ objects ave independent ad they can affect the |= opplet viewer Cfo: Tava applets] I waeoe) Sqn 2 Java C Tove Beet Tay Titec re IS) Ob. i ith | €) Function muinicale i i J och other by passing He each oth bape s jovah (for ¢ header floc) messages Parameter: + jordan ( for creating HTH) clacuments) + fab (Tova debuas ) Foch objeck controls its 4) Eunclions share global | own data. riahles. Ai Disterence between Pop ond oop 8) Ta i 18) “Thert is no data aap Pop. dala Mechanism ia 5 in Shi i Ey String class defines a numberof metheds that elds Mnown os attribules sand calls. — usto accomplish a_Variely of String manipulaliog fie ’ ing Methods = or false | Tn To Th Is the me and enables the Proginm tn enter the expression evaluates ts toy je eS dition) S totic vod main (Shing Cy a el ul So ainlemenk ie anvexienstan tn th 8 SE 1 else stolement 2 i A tudein bo 4 > anda single case i bed hased hich is heing switched The Siniteh is_easier to use instead of pf -elae-if slolema ft. Ti alan enhances the readability of Ye Proginm } Paints 4m be Noted i The case variables can he int » Short. byte char 4 of ova annot be duplicate: Jit) Default Statement i wed when any af the ca doesn't match the value of fon Tt is ‘oponal. the condition is Satistied « a fenal- tft used next case i ecubed Syntax uilich Cexpression)t ase valuelé L Hate ment 1 1 — break j | Sintement Nz break; defaults default Statement; — 2 3 ; System oul printn (“Number is 1") eure rz Calculation hyeals J J public gtatic void main (String CJ args) ¢ default int Gum =o; } fox Cint fol, f<=1o p jee uy = Sum + ff [ Sjain< and exargl 31 Tn _poogiamening Sometimes we need to of code repented! dition TavaSeriot 4 iTa Je boop 2) i The da-while long, checks tne condition at the end ot th, il ! Yong aller ing the loop Stole ments - Lhen the Number = Wiple Hiroe s Hay ifue don't |spoun, filemon isinalkanan ‘tunel ue have ta execle th Loos, _ mations in advan i} 15 reenpom Ot lengt once swe con use do-wwhile Inop n hile donp Unlike far Loop ste ation, Thi nos the exit controlled tonp Since i i Li a | condition is hot checked in advan: lop. | Syntax: the entry controlled loop sines ldo iHinn ia checked at the Short of Abe aap. Le tanditicn is bue then the loop body will be 25 Pea thes dhe Ginlements after 2 ttotin S while Ceond hon), = eCronditinn) Pearl = [public slate void ranin (Sting C1 args) ink 1-0, Systern 3 1 Parameter : OD tne lacp p: itch Statement - ghile loap. | me Bs ota - 2 pablic_class BieakFxampl OW known a Bison enlay cont Tk ts on erik ey public stole vold main(String C Joop 2 i20; i= toppte)t 2)|! Position of Condition is given oli i 13 git condition he beginning of the end of Ia loop. ! pnenls ni execute if ie on, nditinn dass nat | condition ati fa altshys like the hreok Statement, tne continue Statement n't breaks the Inop, Whewas it skips the specit' while Connditinn) do * Joop-ond Jurps ty the next ibeatian of a i inamediately | Stalenoents / 4 TLaghile wh oprintin (Enter num (99g) te Stop): + next Tat (i ue 1=994)1 paintla (You entered 1" evalue)s Values input nextint () System out printin (“Sentinel Value 484 eri canseied iting? whether the lanp Sho: ‘Aepp in Toxo i i i 4 9); blbni- ts Contr! sinlement ? Explain hedge tatements ? fin. hich they a na that can be used bn contm| the jee “Tt Ccomdition) 2 code, 4 iE USkaternent 27. 4 a ‘) Far long | Fvecules & black of fade if ed nurahes af tin 5) if-else ladder i= Ex. Testa multi dition Sequentially and far (nitinlizals ‘dition onpdation & kof cod: = Ly Sralevnents 7 condition ) 4 Hate ments Zi 3) bite i dition 2) | “Executes 0 blosk of code a3 long dition temains tu |__suhile Condition /f LB tatements. 4 i] Do while loop * Condition tes at Nast | dof i ul 7} Tune Crondition) 3) Sump Statements — \heak= Ta break ox Stop the loop. entinue bh 2s Continue = To 1

You might also like