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






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