Only overridden instance methods are
dynamically invoked based on the real object's type.
It means at runtime jvm will look reference inside the reference variable and will find out on the heap what is the actual object- subclass object or superclass object and then it will call the method on it....
so if there was subclass reference inside so subclass method will get execute...
[ July 06, 2007: Message edited by: raj malhotra ]