java_基础 while 循环for循环

public class three {
    public static void main(String[] args){
        //在控制台输出5次helloword
        for(int i = 1;i<=5;i++){
            System.out.println("helloword");
        }
        int j = 1;
        while(j<=5){
            System.out.println("helloword");
            j+=1;

        }
    }
}

 

你可能感兴趣的:(java,开发语言)