I have a little confusion over this mock exam question for
Java 8 cert, if anyone can help a little ?
The question asks what will be printed with the following line of code
What threw me here was the 'continue' and 'break' statements on the same line as the for loop, which, in my mind is valid / same as putting it on the next line.........or maybe not
So, i reformatted the code into how i would normally expect to see for loops (curly braces etc) in order to better understand the 'continue' and 'break' (for the record - i understand what both continue and break do - i've just not seen them on the same line as the for loops before)
Here is my code reformatting of the question...
However, this doesn't compile due to the continue / break now being 'inside' the loop body - can anyone help me understand the continue / break being part of the loop condition(?) or add some comment on the way its used in the question ?
Thanks