定义员工类
定义员工类Employee
-
成员变量:职工号、姓名、性别、工龄、基本工资、交通补贴、午餐补助、奖金
-
定义一个空构造方法和一个能够初始化所有成员变量的构造方法。
-
定义统计实发工资总额的方法
-
利用toString()方法返回员工的所有信息
-
定义方法输出职工号、姓名、工龄、实发工资。
题解
class Employee {
int id;
String name;
String sex;
int workAge;
int basePay;
int transportation;
int lunchSubsidies;
int bonuses;
Employee(int id, String name, String sex, int workAge, int basePay, int transportation, int lunchSubsidies, int bonuses) {
this.id = id;
this.name = name;
this