File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes another True or False statement that confuse me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "another True or False statement that confuse me" Watch "another True or False statement that confuse me" New topic
Author

another True or False statement that confuse me

Max Vandenburg
Ranch Hand

Joined: Mar 09, 2006
Posts: 51
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.


MV
Praveen Babu
Ranch Hand

Joined: Jul 30, 2006
Posts: 138
If the question were what you have stated will that be true or false ?
Max Vandenburg
Ranch Hand

Joined: Mar 09, 2006
Posts: 51
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

Joined: Jul 30, 2006
Posts: 138
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
 
subject: another True or False statement that confuse me