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.
52 lines
1.1 KiB
52 lines
1.1 KiB
// 学生实体类 - Model层
|
|
public class Student {
|
|
private String id;
|
|
private String name;
|
|
private String age;
|
|
private String course;
|
|
|
|
public Student(String id, String name, String age, String course) {
|
|
this.id = id;
|
|
this.name = name;
|
|
this.age = age;
|
|
this.course = course;
|
|
}
|
|
|
|
// Getters and Setters
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getAge() {
|
|
return age;
|
|
}
|
|
|
|
public void setAge(String age) {
|
|
this.age = age;
|
|
}
|
|
|
|
public String getCourse() {
|
|
return course;
|
|
}
|
|
|
|
public void setCourse(String course) {
|
|
this.course = course;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "学生ID: " + id + ", 姓名: " + name + ", 年龄: " + age + ", 课程: " + course;
|
|
}
|
|
} |