Java Programming/Keywords/break

break is a Java keyword.

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

For example:

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


See also:

Last modified on 23 March 2010, at 16:49