Exception Handling

In Java code, exception handling crops up for three reasons:

  • Wrapping checked exceptions (see Checked Exceptions if you are unfamiliar with checked exceptions)

  • Using a finally block to clean up nonmemory resources such as file and network handles

  • Responding to the problem: ignoring the exception, retrying the operation, converting the exception to a nonexceptional result, and so on

Get Programming Clojure, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.