Explanation: Exceptions are handled using try-catch blocks in Java.
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: Exceptions are handled using try-catch blocks in Java.
Explanation: Set does not allow duplicate elements.
String s = "Java";
s.concat(" World");
System.out.println(s);
Explanation: Strings are immutable. concat() returns a new string but does not modify the original.
Explanation: The 'final' keyword prevents class inheritance.
Explanation: ArrayList implements the List interface.
System.out.println("A" + "B" + 10 + 20);
Explanation: String concatenation occurs first, resulting in AB1020.
Explanation: String is a class, not a primitive type.
Explanation: Method overloading means same method name but different parameter lists.
Explanation: Both abstract classes and interfaces provide abstraction.
int a = 10;
if(a = 20) {
System.out.println("Hello");
}
Explanation: Assignment inside if condition is invalid for boolean in Java.