Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1113 :

Posted: Wed Nov 27, 2013 11:58 am
by pawmot
Question: "Which of the following is a legal return type of a method overriding the given method: public Object  myMethod() {...} (Select the best option.)"

Answer listed as correct: "Return type can be any object since all objects can be cast to Object."

"Any object" is not a type. The answer should state "[...] can be any type [...]".

Re: About Question enthuware.ocajp.i.v7.2.1113 :

Posted: Wed Nov 27, 2013 9:50 pm
by admin
Well, it can't be any type because you can't have primitive. But I agree it should be "class" instead of object.

thank you for your feedback!
Paul.

Re: About Question enthuware.ocajp.i.v7.2.1113 :

Posted: Thu Nov 28, 2013 2:59 am
by pawmot
True, my mistake :)