posted 21 years ago
Hi Naveed:
A a = new B();
The declared type is on the left of variable a i.e. A in this case. So rest of the world (I mean program) will see that type of a is A. However, an object of type B is being refered by a. This is actual type of a. So when you call a method on A, the overridden version in the B will be invoked -- which is generally known as polymorphism.