Question: Assume that a CheckingAccount class has a method named 'withdraw' that takes a double representing the amount of money to be withdrawn from the account
Assume that a CheckingAccount class has a method named 'withdraw' that takes a double representing the amount of money to be withdrawn from the account and a field named balance' that holds the current balance in the account. The withdraw method throws a custom exception named OverdrawnException if the amount to be withdrawn is greater than the account balance. The OverdrawnException constructor has a parameter for the current balance of the account. Fill in the blank to complete the code below to throw the exception: public void withdraw(double amount) t if (amount balance) E
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
