Page 1 of 1

About Question enthuware.ocpjp.v7.2.1316 :

Posted: Wed Aug 20, 2014 6:19 pm
by bluster
I just did two tests back to back and I apologize if this is exhaustion-induced stupidity.

If we had objects instead of primitives in the method returns, say Integer and Long on the return types, would the last answer be a correct overriding of the method with a covariant return type Short replacing Long ?

Thanks!

Re: About Question enthuware.ocpjp.v7.2.1316 :

Posted: Wed Aug 20, 2014 8:28 pm
by admin
No, because Long doesn't extend Short.

Re: About Question enthuware.ocpjp.v7.2.1316 :

Posted: Thu Aug 21, 2014 9:44 am
by bluster
Thanks. Now when rested I see how far off I was!