我在处理抽象类的 C# 中做作业。
public abstract class Account
{
public abstract bool Credit(double amount);
public abstract bool Debit(double amount);
}
public class SavingAccount : Account
{
public override bool Credit(double amount)
{
bool temp = true;
temp = base.Credit(amount + calculateInterest());
return temp;
}
public override bool Debit(double amount)
{
bool flag = true;
double temp = getBalance();
temp = temp - amount;
if (temp < 10000)
{
flag = false;
}
else
{
return (base.Debit(amount));
}
return flag;
}
}
当我调用 base.Debit() 或 base.Credit() 时,它给了我无法调用抽象成员的错误。请帮我。