Exception Handling

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

  • Wrapping checked exceptions (see Checked Exceptions if you’re 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, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.