Vidyalelo
Java Programming · Q77

Operators

Programming · Java Programming · question 77

Q77

What will be the output of the following Java code? class Output public static void main(String args[]) int x , y = 1; x = 10; if (x != 10 && x / 0 == 0) System.out.println(y); else System.out.println(++y);

A.
1
B.
2
Answer
C.
Runtime error owing to division by zero in if condition
D.
Unpredictable behavior of program

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board