Teacher implements java.io.Serializable

时间:2021-01-12 17:13:51

package JBJADV003;

public class Teacher implements java.io.Serializable{
private String name;
private int age;
private String gender;
private transient String password;
//包含引用类型数据属性
private Student stu;
public Teacher(String name,Student stu){
this.name=name;
this.stu=stu;
}
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 getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getpassword() {
return password;
}
public void setpassword(String password) {
this.password = password;
}
public Student getstu() {
return stu;
}
public void setstu(Student stu) {
this.stu = stu;
}

}