公共类经理扩展员工{
/**
* Manager Constructor takes in arguements and calls superclass
* @param id
* @param weeklyPay
*/
public Manager(int id, double weeklyPay) // Constructor
{
super(id);
super.weeklyPay=weeklyPay;
}
public String toString() // returns a String
{
return "Manager "+super.toString();
}
public double calculateWeeklyPay() // calculates weeklypay
{
return super.weeklyPay;
}
我必须测试 toString 方法和 calculateWeeklyPay 方法。我该怎么做?