public class SavingAccount extends Account {
private double interestRate;
public SavingAccount(double init_balance,double interest_rate) {
super(init_balance);
interestRate=interest_rate;
}
@Override//withdraw()是一个抽象方法
public boolean withdraw(double amount) {
if(amount<=balance){balance-=amount;return true;}
else return false;
}
}
ziom
相关分类