All pastes #424006 Raw Edit

Mine

public java v1 · immutable
·published 2007-04-04 14:56 UTC
rendered paste body
public class SavingAccount extends BankAccount {	    private static final double INTEREST_RATE = 0.05;    private int accountNumber = 20000;    private static int accInc = 0;            public SavingAccount()    {        super();        accountNumber += accInc++;    }        public SavingAccount(Customer c, double balance)    {        super(c, balance);        accountNumber += accInc++;    }        public void withdraw(double amount)     {        deposit(-1 * amount);    }        public void deposit(double amount)     {        super.deposit(amount);        super.deposit(INTEREST_RATE * getBalance());    }        public String toString()     {        return "Saving Account #" + accountNumber + " with balance $" + getBalance();    }        public int getAccountNumber()     {        return accountNumber;    }}