Method overriding is a perfect example of runtime polymorphism - Core Java

Q.  Which is a perfect example of runtime polymorphism?
- Published on 10 Jul 15

a. Method overloading
b. Method overriding
c. Constructor overloading
d. None of the above

ANSWER: Method overriding
 

    Discussion

  • Rupesh Bharuka   -Posted on 28 Sep 16
    Yes. Method Overriding is runtime polymorphism and Method overloading is compile time polymorphism.

    Runtime polymorphism is also called as Dynamic Polymorphism and Compile time polymorphism is also called as Static Polymorphism.

    We achive runtime polymorphism by implementing method of superclass in subclass(derived class).

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)