Lecture 20
13
Exceptions (service provider)
•
Thrown where error happens
(The idea in BankAccount.java, not real code …):
–
public int withdraw( int amount )
–
{
–
if ( amount > balance ) {
–
throw new InsufficientFundsException();
–
}
–
incrementBalance( -amount );
return amount;
–
}
–