Self-Review Exercises

  1. H.1 List five common examples of exceptions.

  2. H.2 Give several reasons why exception-handling techniques should not be used for conventional program control.

  3. H.3 Why are exceptions particularly appropriate for dealing with errors produced by methods of classes in the Java API?

  4. H.4 What is a “resource leak”?

  5. H.5 If no exceptions are thrown in a try block, where does control proceed to when the try block completes execution?

  6. H.6 Give a key advantage of using catch( Exception exceptionName ).

  7. H.7 Should a conventional application catch Error objects? Explain.

  8. H.8 What happens if no catch handler matches the type of a thrown object?

  9. H.9 What happens if several catch blocks match the type of the thrown object? ...

Get Android How to Program, 3/e 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.