Skip to content
Advertisement

Throwing own exceptions

I have this class Account

JavaScript

Now I also have this exception that I wrote

JavaScript

Now I need to throw this exception in the class account,when the searched account number does not exist.Now my question is in which method(or function I think that is the same,please correct me if I’m wrong) do I throw this exception.And after what check.How would I check if the account number exist,and if it doesnt I’ll throw this exception. Thank you!

EDIT: The class banking, to complete the program

JavaScript

Advertisement

Answer

Extract the common place for acquiring the account

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement