Page 1 of 1

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

Posted: Wed Aug 28, 2013 7:52 am
by DesRenthuware
Hi

The explanation for this question indicates that an explicit cast is required for both answers. While I can understand the downcast required to assign o to r, I don't think b requires it to be explicit (though it does no harm). As b is a subclass of a and inherits all its interfaces, we should be able to upcast b to r implicitly?

Thanks

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

Posted: Wed Aug 28, 2013 8:32 am
by admin
Yes, you are right. The cast is not really required for option 5. The explanation is valid for option 2 only. This has now been fixed.

thank you for your feedback!