class Employee {
private String name;
private double salary;
private String date;
Employee(String vName,double vSalary,String vDate){
this.name=vName;
this.salary=vSalary;
this.date=vDate;
}
public String getName(){
return name;
}
public double getSalary(){
return salary;
}
public String getDate(){
return date;
}
}
class Manager extends Employee{
private double bonus;
Manager(String vName,double vSalary,String vDate,double vBonus){
super(vName,vSalary,vDate);
this.bonus=vBonus;
}
public double getSalary(){
return bonus+super.getSalary();
}
}
public class ManagerTest {
public static void main(String[] args){
Employee staff[]=new Employee[3];
staff[0]=new Employee("Tomny",5000,"2008.8.1");
staff[1]=new Employee("Harry",5000,"2008.8.1");
staff[2]=new Manager("Boss",5000,"2008.8.1",3000);
for(Employee e:staff){
System.out.println("name: "+e.getName()+" salary: "+e.getSalary()+" date: "+e.getDate());
}
}
}