Sebastian Janisch wrote:The break statement has no effect.
Note that you are labeling an if statement not a loop (also why continue won't compile).
As your code stands it does thw following.
Your code breaks out of an if statement that would have ended anyway.
I tried this after finding the illustration: (
source)
And it breaks fine from while loop, which is actually labeled, it prints 8, then breaks, then just for loop procedes. The if statement stands instead of {} here, i assume.