Jump to content
Wikibooks The Free Textbook Project

Java Programming/Keywords/break

From Wikibooks, open books for an open world

break is a Java keyword.

Jumps (breaks) out from a loop. Also used at switch statement.

For example:

Computer code
for(inti=0;i<maxLoopIter;i++){
System.out.println("Iter="+i);
if(i==5){
break;// -- 5 iteration is enough --
}
}


See also:

AltStyle によって変換されたページ (->オリジナル) /