previous | start | next

Answers

  1. If it had been declared inside the try block, its scope would only have extended to the end of the try block, and the catch clause could not have closed it.
  2. The FileReader constructor throws an exception. The finally clause is executed. Since reader is null, the call to close is not executed. Next, a catch clause that matches the FileNotFoundException is located. If none exists, the program terminates.


previous | start | next