Java Staff 类:员工信息管理与操作
public class Staff { private String empNo; private String password; private String empName; private String gender; private String idCardNo; private int age; private int seniority; private double wages; private String title; private String department; private String phoneNum; private String homeAddress;
public boolean login(String empNo, String password) {
if (this.empNo.equals(empNo) && this.password.equals(password)) {
return true;
}
return false;
}
public void showDetail() {
System.out.println('姓名:' + empName);
System.out.println('性别:' + gender);
System.out.println('年龄:' + age);
System.out.println('身份证号:' + idCardNo);
System.out.println('工龄:' + seniority);
System.out.println('工资:' + wages);
System.out.println('职称:' + title);
System.out.println('所属部门:' + department);
System.out.println('联系方式:' + phoneNum);
System.out.println('家庭住址:' + homeAddress);
}
public void alterDetail(String empName, String gender, int age, String idCardNo, int seniority, double wages, String title, String department, String phoneNum, String homeAddress) {
this.empName = empName;
this.gender = gender;
this.age = age;
this.idCardNo = idCardNo;
this.seniority = seniority;
this.wages = wages;
this.title = title;
this.department = department;
this.phoneNum = phoneNum;
this.homeAddress = homeAddress;
}
}
原文地址: https://www.cveoy.top/t/topic/ortX 著作权归作者所有。请勿转载和采集!