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!
About Question enthuware.ocpjp.v7.2.1316 :
Moderator: admin
-
- Posts: 60
- Joined: Wed Apr 23, 2014 6:38 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1316 :
No, because Long doesn't extend Short.
-
- Posts: 60
- Joined: Wed Apr 23, 2014 6:38 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1316 :
Thanks. Now when rested I see how far off I was!
Who is online
Users browsing this forum: No registered users and 8 guests