public class Manager extends Employee { private double bonus; public Manager(String name, double salary, int year, int month, int day) { super(name, salary, year, month, day);//调用超类中含name, salary, year, month, day参数的构造器 bonus = 0; } public double getSalary() { double baseSalary = super.getSalary();//调用超类中的getSalary()方法 return baseSalary + bonus; } public void setBonus(double b) { bonus = b; } }