Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another True or False statement that confuse me

 
Max Vandenburg
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Overriding method cannot throw any exceptions that are not thrown by the overridden method.
(T/F)

the answer is false:
with this explanation
It can throw any exception as long as it is a subclass of any of the exceptions thrown by the overridden method. It can, of course, also be a subclass of RuntimeException.


the "as long as" statement in the explanation here, to me, seems to contradict the word "any" in the questioning statement above.


i think the statement would be alot more clear if it was like this:

Overriding method cannot throw any new checked/broader exceptions that are not thrown by the overridden method.
 
Praveen Babu
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the question were what you have stated will that be true or false ?
 
Max Vandenburg
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it would be true :roll: had i edit the above statemnent to any new or broader checked exceptions (which was what i meant in the first place)instead of any new checked/broader
 
Praveen Babu
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The original answer to the question was false and with your new statement it became true.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic