Question

Which of the following scenarios illustrates runtime polymorphism?

A A method with the same name but different parameters within the same class.
B Overriding a base class method in the derived class and calling it through a base class reference.
C Using default arguments in methods to achieve different outputs.
D Defining a method as static for shared functionality across objects.
E A constructor with a parameter list in the derived class.
Practice Next

Hey! Ask a query