What is the result of the following code?
do { int count = 0; do { count++; } while (count < 2); break; } while (true); System.out.println(count);
C.
At first this code appears to be an infinite loop.
The count variable is declared inside the loop.
It is not in scope after the loop where it is referenced by the println()
.
The code does not compile, and Option C is correct.