Exceptions and Exception Handling in Java
Code examples
- Children sharing apples
- Small example
Home reading
- Exceptions,
in Java Tutorial
- Correctness
and robustness, by David Eck (Suggested reading and exercises)
- Handling
errors using exceptions, by Dick Baldwin
- Throwable
in Java documentation
Practice
Write a method that throws certain
checked exception (use throw-statement and throws-clause) and main
method that handles this exception (use try/catch statement).
Jaanus Pöial, 2006