previous | start | next

Exceptions

public class BankAccount
{
public void withdraw(double amount)
{
if (amount > balance)
throw new IllegalArgumentException(
"Amount exceeds balance");
balance = balance - amount;
}
...
}


previous | start | next