Question 1
What will be the output of the following expression?
System.out.println(10 / 3);
3
3.33
3.0
Compilation Error
Question 2
What will be the output of this Java snippet?
int a = 5;
System.out.println(a++ + ++a);
11
12
10
13
Question 3
What is the result of true && false || true && true?
true
false
Compilation Error
Runtime Error
Question 4
What will be the output of this ternary operation?
int a = 10, b = 20;
int min = (a < b) ? a : b;
System.out.println(min);
10
20
Compilation Error
Undefined Behavior
Question 5
Which operator has the highest precedence in Java?
+ (Addition)
&& (Logical AND)
* (Multiplication)
= (Assignment)
Question 8
Which class is commonly used for taking console input in Java?
FileReader
Scanner
PrintWriter
StringReader
There are 9 questions to complete.