Alex Li的学习笔记

不想学习…

类我已经建好了,但是老师我为什么没有对象啊()

Question 1

代码:

package cc.lixu.oo01;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        System.out.println("24373099 李旭");
        Scanner s = new Scanner(System.in);
        while(!s.nextLine().equals("QUIT")){
            System.out.println("Hello, World!");
            s = new Scanner(System.in);
        }
        System.out.println("----- Good Bye! -----");
        System.exit(0);
    }
}

运行截图:

image-20250918192147960

阅读全文