Tuesday, 31 October 2017

#2. SCJP/OCJP Exams Questions & Answers-Which two statements are true?



2. Given:
35. String #name = "Jane Doe";
36. int $age = 24;
37. Double _height = 123.5;
38. double ~temp = 37.5;

Which two statements are true? (Choose two.)
A. Line 35 will not compile.
B. Line 36 will not compile.
C. Line 37 will not compile.
D. Line 38 will not compile.



Correct Answer. (A,D) 

Explanation. 
Java  के rule  के according , variable  name सिर्फ  alphabets , numerical digit, dollar sign "$", underscore "_" से  कर सकते है | option A  and option D इस rue  को follow नहीं कर रहे है इसलिए ये compile  नहीं होंगे |

No comments:

Post a Comment

#45 to #51 SCJP/OCJP Exams Questions & Answers-

45. Given: 1. public class A { 2. public void doit() { 3. } 4. public String doit() { 5. return "a"; 6. } 7. ...