What does the following code output?
int v = 0; while (v) System.out.println(v++);
Click to view the answer
B.
A while loop requires a boolean condition.
While v is a variable, it is not a boolean.
Therefore, the code does not compile, and Option B is correct.