• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error on chapter 6 mock explanation - question No. 18 (Java OCA 8 Programmer I Study Guide, Sybex)

 
Artem Lovan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer for question No.18 claims the correct answer as A;B;C;D

A -> Checked exceptions are allowed to be handled or declared
B -> Checked exceptions are required to be handled or declared

Obviously it cant hold true for both. I didn't see this one on errata list (to my big surprise) therefor the topic.

If I'm not following the logic, much appreciation for explanation!
checked-exception.png
[Thumbnail for checked-exception.png]
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Artem Lovan wrote:Obviously it cant hold true for both.


It's not obvious to me. It's certainly true that you're allowed to handle and declare checked exceptions in Java -- I've done it myself. There's nothing at all preventing you from doing it.

But you seem to be interpreting A as "It's optional to handle or declare checked exceptions", which is indeed in conflict with B and is indeed false. I suppose that isn't exactly an incorrect interpretation of "allowed to" but it isn't a useful way to think about questions in a formal system.
 
Artem Lovan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My understanding is that its not an option to handle or declare, it's always a requirement to either handle a checked exception or declare it.

But thinking about your post, it might be that I'm looking at "allowed to" from different angle as it was thought of in the explanation.. Thanks!
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I'd be taken off-guard too if I saw the statement "You are allowed to pay your income tax" as an option in a financial literary quiz. Yeah, it's literally true but when you put it up against the idea of being required to pay your income tax all of a sudden it takes on a different meaning.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Artem Lovan wrote:Obviously it cant hold true for both. I didn't see this one on errata list (to my big surprise) therefor the topic.

That seems to be an English thing. So it is not a typo. We had a fairly lengthy discussion on the topic though. Here is another topic about this question (with exactly the same conclusion).

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic