黑马程序员技术交流社区
标题:
容器存储数据综合练习①
[打印本页]
作者:
My_Android
时间:
2016-5-27 20:50
标题:
容器存储数据综合练习①
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;
}
}
复制代码
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2