Multiple choice

What will be the output of the program? int x = l, y = 6; while (y--) { x++; } System.out.println(x = + x + y = + y);

  1. x = 6 y = 0

  2. x = 7 y = 0

  3. x = 6 y = -1

  4. compilation fails

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

Compilation fails because the while loop demands a boolean argument for it's looping condition, but in the code, it's given an int argument. while(true) { //insert code here }