<div dir="ltr" style="text-align: left;">
<div class="separator" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img src="https://dineshonjava.com/wp-content/uploads/2017/08/9.jpg" width="320" height="177" border="0" data-original-="" data-original-width="336" /></div>
<p>Oracle Java Certification Exam was earlier called as SCJP (Sun Certified Java Professional) but after the takeover by Oracle, it’s known as Oracle Java Certification Exam. It is divided into two levels- OCAJP and OCPJP. OCAJP includes Java for beginners, and thus it’s easier than OCPJP whereas OCPJP includes Advanced Java and thus, is complex than OCAJP.<br />
<b></b></p>
<h2><b>OCA / OCP Java SE 8 Programmer Practice Tests</b></h2>
<div class="separator" style="clear: both; text-align: center;"><a href="https://www.amazon.in/gp/product/B06XQR7DVN/ref=as_li_tl?ie=UTF8&;camp=3638&;creative=24630&;creativeASIN=B06XQR7DVN&;linkCode=as2&;tag=dineshonjav06-21&;linkId=217d43449088c80d09ee9f3db984533b" target="_blank" rel="noopener"><img class="aligncenter" src="//ws- in.amazon-adsystem.com/widgets/q?_encoding=UTF8&;MarketPlace=IN&;ASIN=B06XQR7DVN&;ServiceVersion=20070822&;ID=AsinImage&;WS=1&;Format=_SL250_&;tag=dineshonjav06-21" width="256" height="320" border="0" /></a><img style="border: none !important; margin: 0px ! important;" src="//ir-in.amazon-adsystem.com/e/ir?t=dineshonjav06-21&;l=am2&;o=31&;a=B06XQR7DVN" width="1" height="1" border="0" /></div>
<p>OCAJP8 (1Z0-808) is the associate level exam for Java SE 8 Programmer and OCPJP8 (1Z0-809) is the professional level exam for Java SE 8 Programmer. The duration of both the programs is same, which is two and a half hours. However, the numbers of questions asked in both the programs are different. In OCAJP 8, the candidate has to answer 80 questions within 150 minutes. While in OCPJP 8, the candidate has to answer 85 questions within the same time limit. The passing score required in both the exams is 65%. You can’t get OCPJP certification from Oracle if you don’t pass OCAJP Oracle Java exam first. Here are the top questions asked in both the 1Z0-809 and 1Z0-909 exams.</p>
<div class="separator" style="clear: both; text-align: center;"><a href="http://shareasale.com/r.cfm?b=979180&;u=1467018&;m=43514&;urllink=&;afftrack=" target="_blank" rel="nofollow noopener"><img src="https://dineshonjava.com/wp-content/uploads/2017/08/java-certification-6.jpg" width="320" height="267" border="0" data-original-="" data-original-width="336" /></a></div>
<h2><b>Top 10 Questions For OCAJP8 (1Z0-808) Exam:</b></h2>
<div class="MsoNormal"> <b><br style="mso-special-character: line-break; page-break-before: always;" clear="all" /></b></div>
<div style="background: whitesmoke; border: solid #CCCCCC 1.0pt; mso-border-alt: solid #CCCCCC .75pt; mso-element: para-border-div; padding: 7.0pt 7.0pt 7.0pt 7.0pt;">
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Q1. Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Test{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. public static void main(String[] args){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. int []a = {1,2,3,4,5,6};</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. int i = a.length;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. while(i>;=1){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. System.out.print(a[i]);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. i&#8211;;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">13. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What would be the output, if<br />
it is executed as a program?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 123456</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 65432</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. 12345</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. An exception could be<br />
thrown at runtime.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Compile error.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q2.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Ex6{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static void main(String args[]){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. int i = 0, j=10;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. try{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. j /=i;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. System.out.print(&#8220;Divide by Zero!<br />
&#8220;);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. catch(Exception e){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. System.out.print(&#8220;error&#8221;);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What is the output?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 0</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 0 Divide by Zero!</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. Divide by Zero! Error</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Error</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Compilation fails.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">F. An uncaught exception is<br />
thrown at runtime.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q3.</b> Consider</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">&#8211; A and E are Classes</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">&#8211; B and D are interfaces</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">&#8211; C is an abstract class</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which are true? (Choose 3)</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. class F implements B ,C{ }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. class F implements B{ }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. class F extends A,E{ }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. class F extends E{ }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. class F implements B,D{ }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q4.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Test{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static void main(String[] args) {</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. int a[] = {};</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. System.out.print(a instanceof Object);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Note: The keyword<br />
&#8220;instanceof&#8221; is use to check whether an object is of a particular<br />
type</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which is true?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. Will produce output as<br />
false.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. Compilation fails due to<br />
error at line 3.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. Will produce output as<br />
true.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Compilation fails due to<br />
error at line 4.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Length of this array is 3.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q5.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Program{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. static Integer i;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. public static void main(String [] args){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. try{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. System.out.println(i.compareTo(0));</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. }catch ( ArithmeticException |<br />
NullPointerException e){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. System.out.println(&#8220;Exception&#8221;);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which is the output?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. -1</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 0</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. 1</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Exception</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Compilation fails.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q6.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Ex1{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static void main(String[] args) {</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. int a[] = { 1,2,053,4};</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. int b[][] = { {1,2,4} , {2,2,1},{0,43,2}};</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. System.out.print(a[3]==b[0][2] );</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. System.out.print(&#8221; &#8221; +<br />
(a[2]==b[2][1]));</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which is the output?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. true false</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. false false</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. false true</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. true true</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Compilation fails</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q7.</b> Choose three legal<br />
identifiers.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 2ndtName</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. _8_</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. &;name</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. $</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. new</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q8.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Test{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. int value = 10;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. public static void main(String[] args) {</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. new Test ().print();</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. public void print(){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. int value = 8;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. System.out.print(value);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which is the output?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 8</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 10.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. Compilation fails due to<br />
error at line 4.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Compilation fails due to<br />
error at line 7.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q9.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Test{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. static int x = 0;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. public static void main(String[] args) {</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. for(int x=0;x<;5;x++){ }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. System.out.print(x);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which is the output?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 4</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 5</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. 0</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Compilation fails.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Runtime exception will be<br />
thrown.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q10.</b> Given</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Exer{</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static void main(String [] args){</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. String s = &#8220;Java&#8221;;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. s.concat(&#8221; SE 7&#8243;);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. s.replaceAll(&#8220;7&#8243;,&#8221;&#8221;);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. System.out.print(s);</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. }</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What is the result?</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. Java SE &#8220;&#8221;</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. Java SE 7</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. Java SE</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Java.</div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; line-height: normal; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Compilation fails.</div>
</div>
<p> ;</p>
<p> ;</p>
<div class="MsoNormal"></div>
<p><b>Top 10 Questions For OCPJP8 (1Z0-809) Exam:</b></p>
<div class="MsoNormal"></div>
<div style="background: whitesmoke; border: solid #CCCCCC 1.0pt; mso-border-alt: solid #CCCCCC .75pt; mso-element: para-border-div; padding: 7.0pt 7.0pt 7.0pt 7.0pt;">
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q1.</b> Consider the following class:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">public final class Program {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"> final private String name;</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"> Program (String name){</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"> this.name = name;</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"> getName();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"> }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"> //code here</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">}</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which of the following codes will make an instance of this class immutable?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. public String getName(){return name;}</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. public String getName(String value){ name=value; return value;}</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. private String getName(){return name+"a";}</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. public final String getName(){return name+="a";}</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. All of Above.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q2.</b> Consider the following code:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class SuperClass{</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. protected void method1(){</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. System.out.print("M SuperC");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. class SubClass extends SuperClass{</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. private void method1(){</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. System.out.print("M SubC");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. public static void main(String[] args){</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">13. SubClass sc = new SubClass();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">14. sc.method1();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">15. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">16. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What will be the result?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. M SubC.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. M SuperC.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. M SuperCM SubC.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Compilation fails.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. None of above.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q3.</b> Given the following class:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. public class Test {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static void main(String args[]) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. //Code Here</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. Thread thread = new Thread(r);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. thread.start();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">Which of the following lines will give a valid Thread creation?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. Thread r = () ->; System.out.println("Running");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. Run r = () ->; System.out.println("Running");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. Runnable r = () ->; System.out.println("Running");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. Executable r = () ->; System.out.println("Running");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. None Of Above</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q4.</b> Which of the following database urls are correct?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. jdbc:mysql://localhost:3306</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. jdbc:mysql://localhost:3306/sample</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. jdbc:mysql://localhost:3306/sample/user=root?password=secret</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. jdbc:mysql://localhost:3306/sample?user=root&;password=secret</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. All</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q5.</b> Given the following code:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. public class Program {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. public static void main (String args[]) throws IOException {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. Console c = System.console();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. int i = (int)c.readLine("Enter value: ");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. for (int j = 0; j <; i; j++) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. c.format(" %2d",j);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What will be the result of entering the value 5?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 1 2 3 4 5</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 0 1 2 3 4</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. 0 2 4 6 8</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. The code will not compile because of line 5.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Unhandled exception type NumberFormatException at line 7.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q6.</b> Given the following class:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. class Singleton {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. private int count = 0;</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. private Singleton(){};</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. public static final Singleton getInstance(){ return new Singleton(); };</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. public void add(int i){ count+=i; };</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. public int getCount(){ return count;};</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. public class Program {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. public static void main(String[] args) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. Singleton s1 = Singleton.getInstance();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. s1.add(3);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">13. Singleton s2 = Singleton.getInstance();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">14. s2.add(2);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">15. Singleton s3 = Singleton.getInstance();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">16. s2.add(1);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">17. System.out.println(s1.getCount()+s2.getCount()+s3.getCount());</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">18. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">19. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What will be the result?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 18</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 7</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. 6</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. The code will not compile.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. None of above</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q7.</b> Given the following class:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. public class Program {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. public static void main(String[] args) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. List list = Arrays.asList(4,6,12,66,3);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. String s = list.stream().map( i ->; {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. return ""+(i+1);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. }).reduce("", String::concat);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. System.out.println(s);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">13. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What will be the result?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 4612663</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 5713674</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. 3661264</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. The code will not compile because of line 7.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. Unhandled exception type NumberFormatException al line 8.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q8.</b> Which of the following are correct overrides of Object class?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">I. public int hashCode();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">II. public String toString();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">III. public boolean equals(Object obj);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">IV. public Class getClass();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. I, II, III, IV.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. I, II, III.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. I, II.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. III, IV.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. All.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q9.</b> Consider the following class:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. public class Test {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static int count(T[] array, T elem) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3. int count = 0;</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. for (T e : array)</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5. if( e.compareTo(elem) >; 0) ++count;</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. return count;</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9. public static void main(String[] args) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. Integer[] a = {1,2,3,4,5};</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. int n = Test.count(a, 3);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. System.out.println(n);</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">13. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">14. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What will be the result?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. 2</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. 3</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. The code will not compile because of line 5.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. An exception is thrown.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. None of Above.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"></pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;"><b>Q10.</b> Given the following class:</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">1. public class Program {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">2. public static void main(String[] args) {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">3.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">4. Thread th = new Thread(new Runnable(){</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">5.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">6. static {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">7. System.out.println("initial");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">8. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">9.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">10. @Override</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">11. public void run() {</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">12. System.out.println("start");</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">13. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">14. });</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">15.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">16. th.start();</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">17. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">18. }</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">What will be the result?</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">A. start initial</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">B. initial start</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">C. initial</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">D. A runtime exception is thrown.</pre>
<pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: none; margin-bottom: 7.5pt; padding: 0cm; word-break: break-all;">E. The code will not compile because of line 6.</pre>
</div>
<p> ;</p>
<div class="MsoNormal"></div>
<p>Although above are the few best Java certification questions, it’s recommended to go through each topic in detail, and practice questions as the questions vary in each Oracle Java Certification Exam.</p>
<div class="separator" style="clear: both; text-align: center;"><a href="http://shareasale.com/r.cfm?b=979180&;u=1467018&;m=43514&;urllink=&;afftrack=" target="_blank" rel="nofollow noopener"><img src="https://dineshonjava.com/wp-content/uploads/2017/08/java-certification-6.jpg" width="320" height="267" border="0" data-original-="" data-original-width="336" /></a></div>
<p> ;</p>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/what-is-syllabus-for-ocajp8-and-ocpjp8/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/how-ocajp8-ocpjp8-java-certifications-grow-up-your-career-in-the-software-industry/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '23'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…