// Custom checked exception for insufficient funds class InsufficientFundsException extends Exception { public InsufficientFundsException(String message) { super(message); } } // Abstract base class abstract class Account { private String accountNumber; private double balance; public Account(String accountNumber, double initialBalance) { this.accountNumber = accountNumber;
Write an abstract Account class in Java with CheckingAccount and SavingsAccount subclasses. Include deposit and withdraw methods and throw a custom exception when the balance is too low. In main, create two accounts, run a few transactions and mark with a comment where polymorphism is used.
