You can use labels on break statements : break « Statements « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Statements » break 
5.5.2.You can use labels on break statements
public class MainClass {
  public static void main(String[] argv) {
    char[][] array = new char[][] { { 'a''\u0000''v'}'d''e''s'} };

    mainLoop: for (int i = 0; i < array.length; i++) {
      for (int j = 0; j < array[i].length; j++) {
        if (array[i][j== '\u0000') {
          continue mainLoop;
        }
        System.out.println(array[i][j]);
      }
    }

  }
}
a
d
e
s
5.5.break
5.5.1.The break statement terminates execution of a loop.
5.5.2.You can use labels on break statements
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.