Sail E0 Webinar

MCQs

Total Questions : 12 | Page 2 of 2 pages
Question 11. What is the output of this program?class mainclass {public static void main(String args[]) {char a = 'A';a++;System.out.print((int)a);} }
  1.    66
  2.    67
  3.    65
  4.    64
 Discuss Question
Answer: Option A. -> 66


ASCII value of 'A' is 65, on using ++ operator character value increments by one.


Question 12. What is the output of this program?class mainclass {public static void main(String args[]) {boolean var1 = true;boolean var2 = false;if (var1)System.out.println(var1);elseSystem.out.println(var2);} }
  1.    0
  2.    1
  3.    true
  4.    false
 Discuss Question
Answer: Option C. -> true


true


Latest Videos

Latest Test Papers