This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about page 312 (Java OCA 8 Programmer I Study Guide)  RSS feed

 
Cedric Georges
Greenhorn
Posts: 18
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After the example of page 312, explanations are given. But I really don't understand the following sentences:
If the close() method does throw an exception, Java looks for more catch blocks. There aren't any, so the main method throws that new exception. Regardless, the exception on line 28 is handled.

I think the exception throwed by the close() method is caught by the catch block on lines 23-24. Hence, in my point of view, it's not correct to say
... Java looks for more catch blocks. There aren't any, ...

Am I misunderstanding something here (maybe my poor english knowledges aren't helping me...)?

Thank you for your help!
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37261
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book looks wrong. Line 23 does catch that exception.

I'll add this to the errata in a couple days
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37261
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confirmed when I wasn't tired and logged!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!