Page 1 of 1

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

Posted: Thu Jun 05, 2014 3:51 pm
by Nisim123
Hi, well, i must say this is strange, i've read lately in the jls (15.20.2) that:
At run time, the result of the instanceof operator is true if the value of the
RelationalExpression is not null and the reference could be cast (ยง15.16) to the
ReferenceType without raising a ClassCastException. Otherwise the result is
false.
So in this question can we cast an object of class D to be an A?

:?