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.
59 lines
1.2 KiB
59 lines
1.2 KiB
/**
|
|
* 教师:继承Person类,添加教师特有属性
|
|
*/
|
|
public class Teacher extends Person {
|
|
|
|
private String teacherId; // 教师编号
|
|
private String subject; // 教授科目
|
|
|
|
/**
|
|
* 无参构造方法
|
|
*/
|
|
public Teacher() {
|
|
}
|
|
|
|
/**
|
|
* 有参构造方法
|
|
* @param name 姓名
|
|
* @param id 身份证号
|
|
* @param teacherId 教师编号
|
|
* @param subject 教授科目
|
|
*/
|
|
public Teacher(String name, String id, String teacherId, String subject) {
|
|
super(name, id);
|
|
this.teacherId = teacherId;
|
|
this.subject = subject;
|
|
}
|
|
|
|
/**
|
|
* 获取教师编号
|
|
* @return 教师编号
|
|
*/
|
|
public String getTeacherId() {
|
|
return teacherId;
|
|
}
|
|
|
|
/**
|
|
* 设置教师编号
|
|
* @param teacherId 教师编号
|
|
*/
|
|
public void setTeacherId(String teacherId) {
|
|
this.teacherId = teacherId;
|
|
}
|
|
|
|
/**
|
|
* 获取教授科目
|
|
* @return 教授科目
|
|
*/
|
|
public String getSubject() {
|
|
return subject;
|
|
}
|
|
|
|
/**
|
|
* 设置教授科目
|
|
* @param subject 教授科目
|
|
*/
|
|
public void setSubject(String subject) {
|
|
this.subject = subject;
|
|
}
|
|
}
|