?? breakwithlabeldemo.java
字號(hào):
package chapter4;
public class BreakWithLabelDemo {
public static void main(String[] args) {
int[][] arrayOfInts = { { 32, 24, 3, 589 }, { 12, 1076, 2000, 8 },
{ 622, 127, 39, 955 } };
int searchfor = 39;
int i = 0;
int j = 0;
boolean foundIt = false;
search: for (; i < arrayOfInts.length; i++) {
for (j = 0; j < arrayOfInts[i].length; j++) {
if (arrayOfInts[i][j] == searchfor) {
foundIt = true;
break search;
}
}
}
if (foundIt) {
System.out.println("Found " + searchfor + " it the array at " + i + ", " + j);
} else {
System.out.println(searchfor + "not in the array");
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -