Self-Review Exercises
H.1 List five common examples of exceptions.
H.2 Give several reasons why exception-handling techniques should not be used for conventional program control.
H.3 Why are exceptions particularly appropriate for dealing with errors produced by methods of classes in the Java API?
H.4 What is a “resource leak”?
H.5 If no exceptions are thrown in a try
block, where does control proceed to when the try
block completes execution?
H.6 Give a key advantage of using catch( Exception
exceptionName )
.
H.7 Should a conventional application catch Error
objects? Explain.
H.8 What happens if no catch
handler matches the type of a thrown object?
H.9 What happens if several catch
blocks match the type of the thrown object?
H.10 Why would a ...
Get Android™ How to Program, Second 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.