跳出多重循环

/**
* Created by chengtao on 17/1/3.
*/
public class HH {
public static void main(String args[]){

OK:
for (int i =0;i<5;i++){
System.out.println();
OK_1:
for (int j =0;j<6;j++){
int k = getK();
switch (k){
case 8:
System.out.println(i);
break OK;
case 4:
System.out.println(i);
break OK_1;
}
System.out.println("j --->" + j);
}
System.out.println("i -------->" + i);
}

}

public static int getK(){
return 4;
}
}
posted @ 2017-01-03 10:51  为爱奋斗不息  阅读(111)  评论(0编辑  收藏  举报