Java   View all facts   Glossary   Help
syntactic unit > statement > control flow statement > break statement > labelled break statement
Next break statementunlabelled break statement    Upbreak statement

labelled break statement
subjectfact 
labelled break statementhas example
//Without the label the break statement would exit the inner loop and resume execution with the outer loop
out:
for (int i = 0; i < 10; i++) {
while (x < 50) {
if (i * x++ > 400) {
break out;
}
//inner loop here
}
//outer loop here
}
added by: JK, source: Teach Yourself Java 2 in 21 Days, 2001-10-19 11:37:15.0
is a subtopic of Loops and Decision Making2001-10-19 11:37:15.0
is a kind of break statementadded by: JK, source: Teach Yourself Java 2 in 21 Days, 2001-10-19 11:37:15.0
break statementcauses execution to immediately halt the current loop2001-10-19 11:36:12.0
has purpose to terminate a loop or switch-case statement2001-10-19 11:36:13.0
see also break2001-10-19 11:36:13.0
statementis terminated by a semicolon    2001-10-19 11:37:57.0
should be not more than one line long if possible2001-10-19 11:37:57.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0