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.
About Question enthuware.ocajp.i.v8.2.1168 :
Moderator: admin
-
- Posts: 3
- Joined: Wed Oct 10, 2018 4:57 am
- Contact:
About Question enthuware.ocajp.i.v8.2.1168 :
small typo in the explanation of the fourth option ? It should be:
-
- Site Admin
- Posts: 10058
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1168 :
Actually, the text in the explanation is correct but the text in the problem statement is imprecise. Problem statement should say,
I have also updated the explanation as follows to make it clear:Assume that objectOfA, objectOfC1, etc. are references to objects of classes A, C1, and other classes respectively.
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.
If you like our products and services, please help us by posting your review here.
-
- Posts: 3
- Joined: Wed Oct 10, 2018 4:57 am
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1168 :
You're absolutely right...the devil is in the details
Who is online
Users browsing this forum: Bing [Bot] and 108 guests