阅读背景:

如何从多层for循环跳出最外层。。。当然其它方法也可以设置标志变量如flag。。

来源:互联网 
package com.cn.test6;
//如何从多层for循环跳出最外层。。。当然其它方法也可以设置标志变量如flag。。
public class test3 {

 
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		lable1:
			for(int i=0;i<2;i++){
				System.out.println("第一层"+i);
				for(int j=0;j<3;j++){
					System.out.println("第二层"+i+" "+j);
					if(j==1){
						break lable1;
					}
				}
	
			}
			System.out.println("出来了");
	}
	

}
package com.cn.test6;
//如何从多层for循环跳出最外层。。。当然其它方



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: