菜鸟求救
我在做义个有关于继承的联系,但是编译器提示找不到符号,代码如下:import java. util.*;
public class ManagerTest{
public static void main(String[] args){
Manager boss=new Manager("carl",80000,1987,6,4);
boss.setBonus(50000);
Employee[] staff=new Employee[3];
Staff[0]=boss;
staff[1]=new Employee("jiangxudong",70000,1989,3,15);
staff[2]=new Employee("kok",60000,1990,5,4);
for (Employee e:staff)
System.out.println("name="+e.getName()+" salary="+e.getSalary()+" hireday="+e.gethireDay());
}
}
class Employee{
public Employee(String n,double s,int year,int month,int day){
name=n;
salary=s;
GregorianCalendar calendar=new GregorianCalendar(year,month-1,day);
hireday=calendar.getTime();
}
public String getName(){
return name;
}
public double getSalary(){
return salary;
}
public Date gethireDay(){
return (Date)hireday.clone();
}
private String name;
private double salary;
private Date hireday;
}
class Manager extends Employee{
public Manager(String n,double s,int year,int month,int day){
super(n,s,year,month,day);
bonus=0;
}
public double getSalary(){
double basesalary=super.getsalary();
return salary=basesalary+bouns;
}
public void setBonus(double b){
bonus=b;
}
private double bonus;
}