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.
68 lines
1.4 KiB
68 lines
1.4 KiB
package com.student.model;
|
|
|
|
/**
|
|
* 学生实体类,代表系统中的数据模型
|
|
*/
|
|
public class Student {
|
|
private String id; // 学生ID
|
|
private String name; // 学生姓名
|
|
private int age; // 学生年龄
|
|
private String course; // 学生课程
|
|
|
|
/**
|
|
* 构造函数
|
|
* @param id 学生ID
|
|
* @param name 学生姓名
|
|
* @param age 学生年龄
|
|
* @param course 学生课程
|
|
*/
|
|
public Student(String id, String name, int age, String course) {
|
|
this.id = id;
|
|
this.name = name;
|
|
this.age = age;
|
|
this.course = course;
|
|
}
|
|
|
|
// Getter和Setter方法
|
|
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 int getAge() {
|
|
return age;
|
|
}
|
|
|
|
public void setAge(int age) {
|
|
this.age = age;
|
|
}
|
|
|
|
public String getCourse() {
|
|
return course;
|
|
}
|
|
|
|
public void setCourse(String course) {
|
|
this.course = course;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Student{" +
|
|
"id='" + id + '\'' +
|
|
", name='" + name + '\'' +
|
|
", age=" + age +
|
|
", course='" + course + '\'' +
|
|
'}';
|
|
}
|
|
} |