From 205896431dd83739a7be6a86c21c78d4b0b97b2d Mon Sep 17 00:00:00 2001 From: Wangyanshu <2680603193@qq.com> Date: Thu, 2 Apr 2026 00:54:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'w2'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- w2 | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 w2 diff --git a/w2 b/w2 deleted file mode 100644 index f238593..0000000 --- a/w2 +++ /dev/null @@ -1,31 +0,0 @@ -// 定义Student类 -class Student { - // 定义属性 - int studentId; - String name; - double score; - - // 定义study方法 - void study() { - System.out.println("学生" + name + "(学号:" + studentId + ")正在学习,当前成绩为:" + score); - } -} - -// 主类 -public class StudentTest { - public static void main(String[] args) { - // 实例化第一个Student对象 - Student student1 = new Student(); - student1.studentId = 101; - student1.name = "张三"; - student1.score = 92.5; - student1.study(); // 调用study方法 - - // 实例化第二个Student对象 - Student student2 = new Student(); - student2.studentId = 102; - student2.name = "李四"; - student2.score = 88.0; - student2.study(); // 调用study方法 - } -} \ No newline at end of file