Class AbstractAccount

  • Direct Known Subclasses:
    ChequingAccount, SavingsAccount

    public abstract class AbstractAccount
    extends java.lang.Object
    abstract account class to be extended to implement specific bank account types
    Author:
    kriger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int accountNum  
      protected double balance  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractAccount​(int accountNum, double initialBalance)  
    • Field Detail

      • accountNum

        protected final int accountNum
      • balance

        protected double balance
    • Constructor Detail

      • AbstractAccount

        public AbstractAccount​(int accountNum,
                               double initialBalance)
        Parameters:
        accountNum - unique identifier for the account
        initialBalance - funds included in the account when it is created
    • 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:
        toString in class java.lang.Object
      • getBalance

        public double getBalance()
        Returns:
        amount of funds in the account