Run-time polymorphism is achieved by _____.

2018

Run-time polymorphism is achieved by _____.

  1. A.

    friend function

  2. B.

    virtual function

  3. C.

    operator overloading

  4. 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.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs