You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
754 B

package java01;
public class Main {
public static void main(String[] args) {
// 实例化第一个学生对象
Student stu1 = new Student(03030325, "小A", 92.5);
stu1.study();
System.out.println("学号:" + stu1.getStudentId());
System.out.println("姓名:" + stu1.getName());
System.out.println("分数:" + stu1.getScore());
System.out.println("------------------------");
// 实例化第二个学生对象
Student stu2 = new Student(33030326, "小B", 88.0);
stu2.study();
System.out.println("学号:" + stu2.getStudentId());
System.out.println("姓名:" + stu2.getName());
System.out.println("分数:" + stu2.getScore());
}
}