Page 1 of 1

About Question enthuware.ocpjp.v8.2.1128 :

Posted: Thu Jun 30, 2016 4:06 pm
by johnlong
Questions says : Overriding method cannot throw ANY exception that are not thrown by overridden method.

If we say ANY, that means that its ANY exception, without any conditions.
However answer says: It can throw any exception as long as it is a subclass of any of the exceptions thrown by the overridden method.

ANY and "as long as" (conditionally) - is not the same.

Re: About Question enthuware.ocpjp.v8.2.1128 :

Posted: Thu Jun 30, 2016 8:45 pm
by admin
This is a True/False type question and the answer is False for exactly the same reason you mentioned. It is not a true statement. The explanation explains why it is not a true statement.

Re: About Question enthuware.ocpjp.v8.2.1128 :

Posted: Mon Jul 04, 2016 6:53 pm
by johnlong
But then it means that :
Question : Overriding method CANNOT throw ANY exception that are not thrown by overridden method.
Answer : False, overriding method CAN throw ANY exception that are not thrown by overridden method.

Re: About Question enthuware.ocpjp.v8.2.1128 :

Posted: Mon Jul 04, 2016 8:29 pm
by admin
I see your point but I think you are reading too much into this. The given statement is not true, that is for sure. Whether the opposite of it is true or not is not part of the question.

Re: About Question enthuware.ocpjp.v8.2.1128 :

Posted: Tue Jul 05, 2016 7:38 pm
by johnlong
I reckon question has to be rephrased :
Overriding method cannot throw AN exception that is not thrown by overridden method.

Re: About Question enthuware.ocpjp.v8.2.1128 :

Posted: Wed Jul 06, 2016 12:11 am
by admin
Yes, this is false as well but a lot easier to guess. Will update.
thank you for your feedback!

Re: About Question enthuware.ocpjp.v8.2.1128 :

Posted: Wed Jul 06, 2016 5:29 pm
by johnlong
Thank you!