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.
22 lines
513 B
22 lines
513 B
class Student{
|
|
int studentId;
|
|
String name;
|
|
Double score;
|
|
public void study() {
|
|
System.out.println("正在学习的"+name+"学号是"+studentId+",成绩为"+score);
|
|
}
|
|
}
|
|
public class Main{
|
|
public static void main(String[] args){
|
|
Student student1 = new Student();
|
|
student1.name = "小明";
|
|
student1.studentId = 20240101;
|
|
student1.score = 100.00;
|
|
student1.study();
|
|
Student student2 = new Student();
|
|
student2.name = "闲汪";
|
|
student2.studentId = 20240102;
|
|
student2.score = 90.00;
|
|
student2.study();
|
|
}
|
|
}
|