其他分享
首页 > 其他分享> > Break,Continue,goto

Break,Continue,goto

作者:互联网

 

 

package struct;

public class Break {
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            System.out.println(i);
            if (i==30){
                break;
            }
        }
        System.out.println(123);
    }
}
package struct;

public class Continue {
    public static void main(String[] args) {
        int a=0;
        while (a<100){
            a++;
            if (a%10==0){
                System.out.println();
                continue;
            }
            System.out.print(a);
        }
    }
}

 

标签:goto,int,struct,System,Break,Continue,static,public,out
来源: https://www.cnblogs.com/xu529/p/16543342.html