About Question enthuware.ocajp.i.v7.2.983 :
Posted: Wed Aug 28, 2013 7:52 am
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
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