public static void main(String args[]) { int i=10,j=10; outer: while (i > 0) { inner: while (j > 0) { if (j == 8) break outer; System.out.println("内层循环"); j--; } System.out.println("外层循环"); } System.out.println("已跳出循环"); }
时间: 2024-10-12 02:49:10
public static void main(String args[]) { int i=10,j=10; outer: while (i > 0) { inner: while (j > 0) { if (j == 8) break outer; System.out.println("内层循环"); j--; } System.out.println("外层循环"); } System.out.println("已跳出循环"); }