目标
设计一个简单的学校人事管理系统,管理教师和学生信息。实现教师与学生基本信息的添加、删除、修改、查询。其中编号、姓名、性别、出生日期为共有的,教师包括部门、职称、工资;学生包括高考分数、专业field、班级等。
实验代码
package exp4;
public class Person {
/*
* 编号
*/
int id;
/*
* 姓名
*/
String name;
/*
* 性别
*/
String sex;
/*
* 出生日期
*/
String birthday;
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 String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
}
package exp4;
public class Teacher extends Person {
/*
* 部门
*/
String department;
/*
* 职称
*/
String titleJob;
/*
* 工资
*/
double salary;
public Tea