Multiple choice

What will be the output of the program? int i = 0, j = 5; tp: for (;;) { i++;
for (;;) { if(i > --j) { break tp; } } System.out.println("i =" + i + ", j = " + j);

  1. i = 1, j = 0

  2. i = 1, j = 4

  3. i = 3, j = 4

  4. Compilation fails.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

If you examine the code carefully you will notice a missing curly bracket at the end of the code, this would cause the code to fail.