Introduction to Java – Multiple Choice Questions (MCQs)
-
-
38. What is the output of `System.out.println(-8 >> 2);`?
-
39. What is the output of `System.out.println(-8 >>> 2);`?
-
40. Which of the following is a looping construct in Java?
-
41. Which of the following is a selection construct in Java?
-
42. What is the output of `System.out.println(true && false);`?
-
43. What is the output of `System.out.println(true || false);`?
-
44. What is the output of `System.out.println(!true);`?
-
45. What is the purpose of the `break` statement in Java?
-
46. What is the purpose of the `continue` statement in Java?
-
47. What is the output of the following code? `int x = 5; if (x > 3) System.out.println(\Yes\"); else System.out.println(\""No\"");`?"""
-
48. What is the output of the following code? `int y = 2; if (y > 3) System.out.println(\A\"); else if (y == 2) System.out.println(\""B\""); else System.out.println(\""C\"");`?"""