Hi Vidhya,
I dont get why the answer is not C... Quote from
JLS2 - 5.5:
---------------
The detailed rules for compile-time correctness checking of a casting conversion of a value of compile-time reference type S (source) to a compile-time reference type T (target) are as follows:
If S is a class type: If T is an interface type:
If S is not a final class (�8.1.1), then the cast is always correct at compile time (because even if S does not implement T, a subclass of S might).
---------------
In the sample code posted by Ganesh, class A is the S and interface E is the T. Since class A is not
final, it can be extended and its subclasses may implement E.
For example:
Example with class A being declared as final:
Example with E as a class:
Joyce