Exceptions
lecture
java
exceptions
See csse2002 for course logistics.
Today’s outline
- Exceptions
- Specification (recap)
Exceptions
See java-exceptions — the exception hierarchy, checked vs unchecked exceptions, try/catch/throw/throws/finally, and custom exceptions.
Specification
This part of the lecture repeats Week 3’s java-specification material near-verbatim (Javadoc, restrictiveness, generality, clarity, formality, contracts, defensive programming) — see that note rather than duplicating it here. Two small additions from this week’s repeat have been folded into it: an early-return variant of the search generality example, and an added Effective Java citation for defensive programming/doc comments.