Jones
Jones Iraland wrote:Hi,
polymorphism invokes methods according to reference variable type and only do overriding ,but in overiding methods invocation happens according to object type and not reference type.
Cheers,
Johns
If i understood your question correctly.. this is polymorphism..
In overriding it says "Object type not the reference variable type determines which overridden method is used at runtime."
During compile time , compiler checks for the reference type and if it has called methods in it.. only during runtime , the object that gets created will call its own inherited method ( if method is not overridden) or overriden method (if overrideen) . wats your doubt ?