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.
56 lines
938 B
56 lines
938 B
/**
|
|
* 人员抽象基类:包含人员的基本属性
|
|
*/
|
|
public class Person {
|
|
|
|
private String name;
|
|
private String id;
|
|
|
|
/**
|
|
* 无参构造方法
|
|
*/
|
|
public Person() {
|
|
}
|
|
|
|
/**
|
|
* 有参构造方法
|
|
* @param name 姓名
|
|
* @param id 身份证号
|
|
*/
|
|
public Person(String name, String id) {
|
|
this.name = name;
|
|
this.id = id;
|
|
}
|
|
|
|
/**
|
|
* 获取姓名
|
|
* @return 姓名
|
|
*/
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
/**
|
|
* 设置姓名
|
|
* @param name 姓名
|
|
*/
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
/**
|
|
* 获取身份证号
|
|
* @return 身份证号
|
|
*/
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
/**
|
|
* 设置身份证号
|
|
* @param id 身份证号
|
|
*/
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
}
|