Break
suggest changeThe break statement ends a loop (like for, while) or the evaluation of a switch statement.
Loop:
while(true) {
if (value == 5) {
break;
}
}
The loop runs until value is 5. value is an int in the surrounding code; a boolean cannot be compared with 5.
break ends only the innermost loop or switch. It does not end an enclosing loop. A labeled break does.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents