package xmp_constructor_inheritance;

public class BankAccount { // Extends object

	private double balance;

	public BankAccount() {
		this(0.0); // Invoke alternate creator method
	}
	
	public BankAccount(double initBal) {
		super();
		balance=initBal;
		if(this instanceof SavingsAccount) {
			System.out.println("In BankAccount: " + ((SavingsAccount)this).getInterestRate());
		}
	}

	/**
	 * @return the balance
	 */
	public double getBalance() {
		return balance;
	}

	/**
	 * @param balance the balance to set
	 */
	public void setBalance(double balance) {
		this.balance = balance;
	}

}
