49 无限循环

发布时间 2023-06-06 12:33:08作者: 胖豆芽

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");
        }

    }
}