rendered paste bodyackage oving6;
public class SavingsAccount extends AbstractAccount {
public SavingsAccount() {
super();
}
@Override
public String getAccountType() {
return "Savings account";
}
@Override
public int deposit(int amount) {
if (amount >= 0) {
this.addTransaction(amount, "d");
}
return this.getBalance();
}
@Override
public int withdraw(int amount) {
if (amount >= 0 && this.getBalance() - amount > 0) {
this.addTransaction(-amount, "w");
this.addTransaction(-2, "f");
}
return this.getBalance();
}
}