例:
public class Test {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
if (i == 5)
continue;
System.out.print(i + " ");
}
System.out.println();
for (int j = 0; j < 10; j++) {
if (j == 5)
break;
System.out.print(j + " ");
}
}
}
输出结果:0 1 2 3 4 6 7 8 9
0 1 2 3 4