// labeled break
// break out of the outer loop marked by the label

public class labeledBreak {
	public static void main(String[] args) {
	int[][] arrayOfInts = { {1,2}, {4,5}, {7,8}};
	int searchfor = 8;
	int i=-1,j=-1 ;
	boolean foundIt = false;
	

	outer:
	for ( i = 0 ; i < arrayOfInts.length; i++) {
	    for ( j = 0 ; j < arrayOfInts[i].length; j++) {
		System.out.println ("searching at " + i + " " + j);
		if (arrayOfInts[i][j] == searchfor) { foundIt = true; break outer; }
		// break breakes the labeled statement and does not goto that label
	    }
   	}

   	if (foundIt) {
		System.out.println("Found " + searchfor + " at index " + i + "," + j);
     	} else 
		{ System.out.println(searchfor + "not in the array"); }

	}
}


