Explanation: Java Compiler (javac) is outside JVM.
Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: Java Compiler (javac) is outside JVM.
System.out.println(1 << 2);
Explanation: Left shift multiplies by 2^n, so 1<<2 = 4.
System.out.println(10 >> 1);
Explanation: Right shift divides by 2, so 10>>1 = 5.
Explanation: final is used to declare constants.
String s = "abc"; s.toUpperCase(); System.out.println(s);
Explanation: String is immutable, so original value remains unchanged.
Explanation: Both Vector and ArrayList provide dynamic arrays.
Explanation: finalize() was used by GC before removal (deprecated now).
Explanation: Serializable is a marker interface.
System.out.println("5" + 5 * 5);
Explanation: 5*5=25 then concatenation gives 525.
Explanation: Invalid array index throws ArrayIndexOutOfBoundsException.