Question 66

Run-time polymorphism is achieved by ______.

  1. AFriend function
  2. BVirtual function
  3. COperator overloading
  4. DFunction overloading
Show answerHide answer

Correct answer: (B) Virtual function

Explanation

Virtual functions give run-time (dynamic) polymorphism: the function called is chosen at run time from the object's actual type. Overloading is resolved at compile time.

From DSSSB TGT Computer Science Practice Set 4

This is question 66 of DSSSB TGT Computer Science Practice Set 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.