posted 15 years ago
Hi Sudarshan and Vijitha,
First of all I will be thankful for spending your valuable time for claring my doubt.
Still I am not clear about above code?
According to my knowledge, above code will be checked at compile time and time time.
During compile time:
Is-A relation exists between type of x(here i.e. I) and J?
But IS-A relation is not satisfied in case of
According to my Knowledge, compile time error should be genereated because there is no IS-A relationship between type of x and J
If the compile time check passes, then at runtime actual object class referenced by x is same or subtype of J.
If above two cases satisfies, then
output will be printed.
Please correct me if my understanding is wrong? Waiting for reply!
Thanks in advance.
Regards,
Goapl