【Java】员工管理系统(简版)
简易版员工管理系统,只追求基本原理
需求
- 主要功能:
- 添加员工:通过键盘录入员工生信息,添加到集合中
- 删除员工:通过键盘录入要删除员工的工号,将该员工对象从集合中删除
- 修改员工:通过键盘录入要修改员工的工号,将该员工对象其他信息进行修改
- 查看员工:将集合中的员工对象信息进行展示
- 退出系统:结束程序
实现效果
- 添加、查看
- 修改、查看
- 删除、查看
- 退出
代码
- pojo:员工类
package com.cxl.demo03_Staff.pojo;
public class Staff {
private String id;
private String name;
private String age;
private String birthday;
public Staff() {
}
public Staff(String id, String name, String age, String birthday) {
this.id = id;
this.name = name;
this.age = age;
this.birthday = birthday;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
}
- 测试类
package com.cxl.demo03_Staff;
import com.cxl.demo03_Staff.pojo