在break和continue后可以加上循环的标签来表示结束指定的循环
outer:
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 10; j++) {
if (j % 4 == 0) {
break outer;//结束指定标识的循环
}
System.out.print(j);
}
System.out.println();
}
2023-08-10 18:48:04
outer:
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 10; j++) {
if (j % 4 == 0) {
break outer;//结束指定标识的循环
}
System.out.print(j);
}
System.out.println();
}
下一篇:oracle基础3——多表联查