I selected the answer "It will not compile" as the code displayed would NOT compile on its own. The correct answer was "It will print numbers 0 to 4" - I guess that is true if you are assuming this is in a proper class with a main method calling this method properly.What will the following code print?
void crazyLoop()
{
int c = 0;
JACK: while (c < 8)
{
JILL: System.out.println(c);
if (c > 3) break JACK; else c++;
}
}
Is this a typo or are these situations common on the test (where you have to just guess at the imaginary context of the code displayed)?