做作业时看到的 Demo
1 public class HelloWorld { 2 public static void main(String[] args) { 3 outer: 4 for(int i = 0;i < 3; i++, System.out.println("\t OUTER "+i)) 5 inner: 6 for (int j=0; j<2; j++, System.out.println("\t INNER " + j)){ 7 if (j == 1) { 8 System.out.println("\t go1"); 9 continue outer; 10 } 11 System.out.println(j+" and " + i + ";"); 12 } 13 14 15 System.out.println("---------------EOF----------------"); 16 } 17 }
运行结果

附上:
本文来自博客园,作者:蓝天上的云℡,采用 BY-NC-SA 许可协议,转载请注明:转载自作者蓝天上的云℡ 原文链接 https://www.cnblogs.com/yucloud/p/11602425.html

浙公网安备 33010602011771号