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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package com.studentmanagement.model ;
/**
* 学生实体类,代表系统中的学生数据模型
* MVC模式中的Model部分, 负责存储数据
*/
public class Student {
private int id ;
private String name ;
private int age ;
private String course ;
private double grade ;
/**
* 构造函数
* @param id 学生ID
* @param name 学生姓名
* @param age 学生年龄
* @param course 学生课程
* @param grade 学生成绩
*/
public Student ( int id , String name , int age , String course , double grade ) {
this . id = id ;
this . name = name ;
this . age = age ;
this . course = course ;
this . grade = grade ;
}
// Getters and Setters
public int getId ( ) {
return id ;
}
public void setId ( int 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 ;
}
public double getGrade ( ) {
return grade ;
}
public void setGrade ( double grade ) {
this . grade = grade ;
}
@Override
public String toString ( ) {
return "Student{" +
"id=" + id +
", name='" + name + '\'' +
", age=" + age +
", course='" + course + '\'' +
", grade=" + grade +
'}' ;
}
}