Skip to main content
Rollback to Revision 7
Source Link
SOFe
  • 8.3k
  • 5
  • 37
  • 67

It is not a keyword it is a label.

Usage:

 label1: for (; ; ) { label2: for (; ; ) { if (condition1) { // break outer loop break label1; } if (condition2) { // break inner loop break label2; } if (condition3) { // break inner loop break; } } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

 label1: for () { label2: for () { if (condition1) { // break outer loop break label1; } if (condition2) { // break inner loop break label2; } if (condition3) { // break inner loop break; } } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

 label1: for (; ; ) { label2: for (; ; ) { if (condition1) { // break outer loop break label1; } if (condition2) { // break inner loop break label2; } if (condition3) { // break inner loop break; } } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

code was messed up
Source Link
SOFe
  • 8.3k
  • 5
  • 37
  • 67

It is not a keyword it is a label.

Usage:

 label1: for (; ; ) { label2: for (; ; ) { if (condition1) { // break outer loop break label1; } if (condition2) { // break inner loop break label2; } if (condition3) { // break inner loop break; } } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

 label1: for (; ; ) { label2: for (; ; ) { if (condition1) { // break outer loop break label1; } if (condition2) { // break inner loop break label2; } if (condition3) { // break inner loop break; } } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

 label1: for () { label2: for () { if (condition1) { // break outer loop break label1; } if (condition2) { // break inner loop break label2; } if (condition3) { // break inner loop break; } } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

 label1:  for (; ; ) {   label2:   for (; ; ) {   if (condition1) { break label1; // break outerloopouter loop   break label1; }   if (condition2) { // break inner loop   break label2; } if (condition3) { // break innerloopinner loop break; }   }  } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

label1: for(){ label2: for(){ if(condition1) break label1;//break outerloop if(condition2) break label2;//break innerloop } } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

It is not a keyword it is a label.

Usage:

 label1:  for (; ; ) {   label2:   for (; ; ) {   if (condition1) {  // break outer loop   break label1; }   if (condition2) { // break inner loop   break label2; } if (condition3) { // break inner loop break; }   }  } 

[Documentation][1]. [1]: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.7

Fixed documentation link
Source Link
Bernhard Barker
  • 55.7k
  • 14
  • 111
  • 143
Loading
added 1 characters in body
Source Link
Jigar Joshi
  • 241.4k
  • 42
  • 409
  • 446
Loading
added 11 characters in body
Source Link
Jigar Joshi
  • 241.4k
  • 42
  • 409
  • 446
Loading
added 232 characters in body
Source Link
Jigar Joshi
  • 241.4k
  • 42
  • 409
  • 446
Loading
Link changed to the current JLS and relevant section.
Source Link
Tom Hawtin - tackline
  • 147.6k
  • 30
  • 222
  • 314
Loading
Source Link
Jigar Joshi
  • 241.4k
  • 42
  • 409
  • 446
Loading