这是一个小型的学生信息管理系统
源代码在线查看: student.java
/**
文件:Student.java
说明:说明学生的类文件
**/
//导入相关类文件
import java.text.*;
import java.util.*;
public class Student extends Person{
// 学号
public String Sno;
// 院系名称
public String Department;
// 入学日期
public Date EnrollmentDate;
// 构造方法1
public Student(String IID,String Iname,String Isex, Date IbrithDate,String ISno,String IDepartment, Date IEnrollmentDate)
{
super(IID, Iname, Isex, IbrithDate);
this.Sno = ISno;
this.Department = IDepartment;
this.EnrollmentDate = IEnrollmentDate;
}
// 构造方法2
public Student(String ISno, String Iname, String Isex, String IDepartment, Date IEnrollmentDate)
{
super(null, Iname, Isex, null);
this.Sno = ISno;
this.Department = IDepartment;
this.EnrollmentDate = IEnrollmentDate;
}
public String getSno()
{
return Sno;
}
public String getDepartment()
{
return Department;
}
public String getEnrollmentDate()
{
String strDate = EnrollmentDate.toString();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
String CNtime = fmt.format(EnrollmentDate);
return CNtime;
}
}