Home » Java Programming » Flow Control

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);

Correct Answer: Compilation fails.

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.

← Previous Question Next Question→

More Questions from Flow Control

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion