49 无限循环

for循环

package com.fqs.test;

import java.util.Scanner;
public class hello {
    public static void main(String[] args) {
       //无限循环
        for(;;){
            System.out.print("study");
        }

    }
}

while循环

package com.fqs.test;

import java.util.Scanner;
public class hello {
    public static void main(String[] args) {
       //无限循环
        while(true){
            System.out.print("study");
        }

    }
}

 

posted @ 2023-06-06 12:29  胖豆芽  阅读(19)  评论(0编辑  收藏  举报