定义Staff类(职工),包含 dateHired, dateHired为雇佣日期(java.util.Date类型
时间: 2023-05-31 13:01:46 浏览: 241
),以及firstName,lastName,address,email,phone等属性,并提供对应的getters和setters方法。
```
import java.util.Date;
public class Staff {
private Date dateHired;
private String firstName;
private String lastName;
private String address;
private String email;
private String phone;
public Date getDateHired() {
return dateHired;
}
public void setDateHired(Date dateHired) {
this.dateHired = dateHired;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}
```
阅读全文