From 1ea0fe0f865550b68a1640637e6048c7ad897554 Mon Sep 17 00:00:00 2001 From: YangYuting <3481369387@qq.com> Date: Thu, 19 Mar 2026 10:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'README2.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README2.md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 README2.md diff --git a/README2.md b/README2.md deleted file mode 100644 index 5a9bda6..0000000 --- a/README2.md +++ /dev/null @@ -1,44 +0,0 @@ -// Student.java -public class Student { -// 成员属性 -private int studentId; -private String name; -private double score; - - // 构造方法(用于创建对象时给属性赋值) - public Student(int studentId, String name, double score) { - this.studentId = studentId; - this.name = name; - this.score = score; - } - - // study() 方法 - public void study() { - System.out.println(name + "(学号:" + studentId + ")正在学习,当前成绩:" + score); - } - - // 可选:getter/setter 方法(用于访问/修改私有属性) - public int getStudentId() { - return studentId; - } - - public String getName() { - return name; - } - - public double getScore() { - return score; - } -} - -public class Main { -public static void main(String[] args) { -// 实例化两个 Student 对象 -Student stu1 = new Student(2026001, "张三", 90.5); -Student stu2 = new Student(2026002, "李四", 88.0); - - // 调用 study() 方法 - stu1.study(); - stu2.study(); - } -} \ No newline at end of file