posted 19 years ago
In line 3 u r trying to cast a base class object to a derived class,which causes the compile time error,as this does not make any sense.(Only derived class objects can be casted to base class objects.
In line 4 though u r trying to cast the interface reference to the base class,the underlying object to which the reference i is pointing is a base class object,so casting a base class object to itself does not cause a compile time error.
SCJP 1.4
Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment.