我在程序中收到警告,即“Employee.Salaried.CalculatePay()”隐藏了继承的成员“Employee.Employee.CalculatePay()”。如果打算隐藏,请使用 new 关键字。为了这
public double CalculatePay()
{
return ((AnnualSalary * (ManagementLevel * BONUS_PERCENT)) + AnnualSalary) / 52;
}
有人对如何摆脱那里的警告有建议吗?
public double CalculatePay()
{
return annualSalary / 52;
}
public double CalculatePay(double modifiedSalary)
{
AnnualSalary = modifiedSalary;
return AnnualSalary / 52;
}