Employee
ava import java
Calendar; import java
GregorianCalendar; public class Employee { /** * Employee:这是所有员工总的父类,属性:员工的姓名和生日月份
方法:getSalary(int month) 根据参数月份来确定工资, * 如果该月员工过生日,则公司会额外奖励 100 元
*/ private String name; protected int month; private int base = 6000; private int salary; public Employee() { } public Employee(String name, int month) { this
setName(name); this
setMonth(month); } public String getName() { return name; } public void setName(String name) { this
name = name; } public int getMonth() { return month; } public void setMonth(int month) { this
month = month; } GregorianCalendar g = new GregorianCalendar(); int flag = (int) g
get(Calendar
MONTH) + 1; public int getSalary(int month) { int s = this
getMonth(); if (flag == s) { salary = base + 100; } else salary = b