- import java.text.DateFormat;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- /**
- * 雇员类
- * @author hasee
- *
- */
- public class Employee { //Javabean 实体类
-
- private int id; // 雇员id
- private String name; // 雇员姓名
- private double salary; // 雇员薪水
- private String company; // 雇员单位
- private Date entryDate; // 雇员入职日期
-
- public Employee(int id, String name, double salary, String company, String entryDate) {
- this.id = id;
- this.name = name;
- this.salary = salary;
- this.company = company;
- DateFormat format = new SimpleDateFormat("yyyy-MM");
- try {
- this.entryDate = format.parse(entryDate);
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
-
- 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 double getSalary() {
- return salary;
- }
- public void setSalary(double salary) {
- this.salary = salary;
- }
- public String getCompany() {
- return company;
- }
- public void setCompany(String company) {
- this.company = company;
- }
- public Date getEntryDate() {
- return entryDate;
- }
- public void setEntryDate(Date entryDate) {
- this.entryDate = entryDate;
- }
- }
复制代码
|
|