Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Self-Review Exercises

11.1List five common examples of exceptions.
11.2Give several reasons why exception-handling techniques should not be used for conventional program control.
11.3Why are exceptions particularly appropriate for dealing with errors produced by methods of classes in the Java API?
11.4What is a “resource leak”?
11.5If no exceptions are thrown in a try block, where does control proceed to when the try block completes execution?
11.6Give a key advantage of using catch( Exception exceptionName).
11.7Should a conventional application catch Error objects? Explain.
11.8What happens if no catch handler matches the type of a thrown object?
11.9What happens if several catch blocks match the type of the thrown object?
11.10Why would a programmer specify a superclass type as the type in a catch block?
11.11What is the key reason for using finally blocks?
11.12What happens when a catch block throws an Exception?
11.13What does the statement throw exceptionReference do in a catch block?
11.14What happens to a local reference in a try block when that block throws an Exception?


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint