















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















































How do we do this?
Catching Exceptions
Exception Program Flow
Why have exception handling?
What exceptions can occur?
How to handle Exceptions? Do nothing
Throwing Exceptions
Problem public class BankAccount { public void withdraw(double amount) { if (amount > balance) { ????????? } balance = balance - amount; }
... }
Solution #
Checked/Unchecked Exceptions