用java帮我写个学生类,里面有id,年龄,姓名,身高,体重和入学时间
时间: 2024-05-24 18:12:55 浏览: 93
public class Student {
private String id;
private int age;
private String name;
private double height;
private double weight;
private String enrollmentDate;
public Student(String id, int age, String name, double height, double weight, String enrollmentDate) {
this.id = id;
this.age = age;
this.name = name;
this.height = height;
this.weight = weight;
this.enrollmentDate = enrollmentDate;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getHeight() {
return height;
}
public void setHeight(double height) {
this.height = height;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public String getEnrollmentDate() {
return enrollmentDate;
}
public void setEnrollmentDate(String enrollmentDate) {
this.enrollmentDate = enrollmentDate;
}
}
阅读全文