previous | start | next

Scenario

  1.  PurseTest.main calls Purse.readFile
  2. Purse.readFile calls Purse.read
  3. Purse.read calls Coin.read
  4. Coin.read throws an EOFException
  5. Coin.read has no handler for the exception and terminates immediately. 
  6. Purse.read has no handler for the exception and terminates immediately
  7. Purse.readFile has no handler for the exception and terminates immediately after executing the finally clause and closing the file. 
  8. PurseTest.main has a handler for an IOException , a superclass of EOFException. That handler prints a message to the user. Afterwards, the user is given another chance to enter a file name. Note that the statement printing the purse total has been skipped.


previous | start | next