Self-Review Exercises
11.1 List five common examples of exceptions.
11.2 Why are exceptions particularly appropriate for dealing with errors produced by methods of classes in the Java API?
11.3 What is a “resource leak”?
11.4 If no exceptions are thrown in a try block, where does control proceed to when the try block completes execution?
11.5 Give a key advantage of using catch(Exception exceptionName).
11.6 Should a conventional application catch Error objects? Explain.
11.7 What happens if no catch handler matches the type of a thrown object?
11.8 What happens if several catch blocks match the type of the thrown object?
11.9 Why would a programmer specify a superclass type as the type in a catch block?
11.10 What is the key reason for using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access