package inheritance;

public abstract class AbstractAccount {

	protected double balance;

  public void deposit(double amount) {
    if (amount < 0)
      throw new IllegalArgumentException("Can not deposit a negative amount of money.");
    this.balance += amount;
  }

  public void withdraw(double amount) {
    if (amount < 0)
      throw new IllegalArgumentException("Can not withdraw a negative amount of money.");
    internalWithdraw(amount);
  }

  public abstract void internalWithdraw(double amount);

  public double getBalance() {
    return balance;
  }

}
