posted 18 years ago
Can someone please explain the resolution rule, based on the program below...
---- Output -----------------
---------------------------------------------------
At lines marked 1 and 2 , I created object of B and assigned it in variables of type B and A respectively.
At lines 3 and 7, call is made on an actual instance of B, produce different results why so?
Similarly line 5 and 9, is giving different result.
Line 6 is giving a compile time error though the same call at line 10 is working fine..
Similarly line 8 is throws compile time error, where as the same call works at line 4
Someone please explain me why the calls gets routed to different methods when only the
type of the variable holding actual reference is different.?
[ July 26, 2005: Message edited by: Barry Gaunt ]