public abstract class Employee {
public int theMoney(){
return 0;
}
}
class AgradeEmployee extends Employee{
private int theMoneyOfA;
public int theMoney(){
return theMoneyOfA;
}
}
class BgradeEmployee extends Employee{
private int theMoneyOfB;
public int theMoney(){
return theMoneyOfB;
}
}
class CgradeEmployee extends Employee{
private int theMoneyOfC;
public int theMoney(){
return theMoneyOfC;
}
}
class Company{
private int theNum;
Employee[] em=new Employee[theNum];
public void init(int i,Employee e){
em[i]=e;
}
public int sum(){
int sum=0;
for(int i=0;i sum+=em[i].theMoney();
}
return sum;
}
}