Class NegativeBalanceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
makingtransactions.NegativeBalanceException
All Implemented Interfaces:
Serializable

public class NegativeBalanceException extends Exception
A custom exception for cases where credit on a transaction is bigger than the balance on a bank account.
See Also:
  • Constructor Details

    • NegativeBalanceException

      public NegativeBalanceException(double credit, double balance)
      Throw the NegativeBalanceException, to avoid a negative balance on a bank account.
      Parameters:
      credit - The credit of the transaction.
      balance - The balance on the bank account.
  • Method Details