public class hello {
public static void main(String[] args) {
int count=1;
A:for(int i = 0;i<3;i++) {
B:for(int j = 0;j<3;j++) {
if(j == 0) {
System.out.println(i+" "+j);
break B;
}
else {
System.out.println("-.-");
}
}
}
//System.out.println();
}
}
结果为:
0 0
1 0
2 0
break B 跳出当前B循环
标号语句中试用break类型即可



