Page 1 of 1
About Question enthuware.ocajp.i.v8.2.1168 :
Posted: Fri Dec 06, 2019 8:11 am
by MarcATC
small typo in the explanation of the fourth option ? It should be:
Since c1 is declared of type C1, an objectOfA of class A, cannot be assigned to c1 because A is not a C1. A C1 is an A. So A a = objectOfC1; would have been valid.
Re: About Question enthuware.ocajp.i.v8.2.1168 :
Posted: Fri Dec 06, 2019 8:27 am
by admin
Actually, the text in the explanation is correct but the text in the problem statement is imprecise. Problem statement should say,
Assume that objectOfA, objectOfC1, etc. are references to objects of classes A, C1, and other classes respectively.
I have also updated the explanation as follows to make it clear:
Since c1 is declared of type C1, an object of class A (which is what the reference objectOfA is pointing to, as given in the problem statement), cannot be assigned to c1 because A is not a C1. A C1 is an A. Therefore, A a = objectOfC1; would have been valid.
Re: About Question enthuware.ocajp.i.v8.2.1168 :
Posted: Fri Dec 06, 2019 8:33 am
by MarcATC
You're absolutely right...the devil is in the details
