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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
DesRenthuware
Posts: 32
Joined: Wed Aug 28, 2013 6:12 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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!

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests