public class Hello {
public static void main(String args[]) {
for (int x = 0; x <= 10; x++) {
if (x == 3) {//x=3不执行了
continue;//执行此语句之后循环体后面的代码不执行了
}
System.out.println("x =" + x);
}
}
}
public class Hello {
public static void main(String args[]) {
mp:
for (int x = 0; x < 2; x++) {
for (int y = 0; y < 3; y++) {
if (x > 2) {
continue mp;
}
System.out.println("x =" + x + ",y =" + y);
}
}
}
}
x =0,y =0
x =0,y =1
x =0,y =2
x =1,y =0
x =1,y =1
x =1,y =2