Package BankAccountPkg
Class AbstractAccount
- java.lang.Object
-
- BankAccountPkg.AbstractAccount
-
- Direct Known Subclasses:
ChequingAccount,SavingsAccount
public abstract class AbstractAccount extends java.lang.Objectabstract account class to be extended to implement specific bank account types- Author:
- kriger
-
-
Field Summary
Fields Modifier and Type Field Description protected intaccountNumprotected doublebalance
-
Constructor Summary
Constructors Constructor Description AbstractAccount(int accountNum, double initialBalance)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voiddeposit(double amount)doublegetBalance()abstract java.lang.StringtoString()abstract voidwithdraw(double amount)
-
-
-
Method Detail
-
deposit
public abstract void deposit(double amount)
- Parameters:
amount- funds to be added to the account
-
withdraw
public abstract void withdraw(double amount)
- Parameters:
amount- funds to be removed from the account
-
toString
public abstract java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getBalance
public double getBalance()
- Returns:
- amount of funds in the account
-
-