Run-time polymorphism is achieved by _____.
2018
Run-time polymorphism is achieved by _____.
- A.
friend function
- B.
virtual function
- C.
operator overloading
- D.
function overloading
Attempted by 305 students.
Show answer & explanation
Correct answer: B
Key idea: Run-time polymorphism is achieved by virtual functions. Definition: A virtual function is declared in a base class and overridden (redefined) in a derived class. Calls made through a base-class pointer or reference are dynamically bound to the derived-class implementation at run time. Step 1: Declare the function as virtual in the base class.