Question 96Asked in DSSSB PGT Computer Science (Technical), 11 Jul 2021

Which of the following statement is NOT correct regarding Virtual function in C++?

Which of the following statement is NOT correct regarding Virtual function in C++? I. It must be a member of some class. II. It is accessed by using object points.
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (D) Neither I nor II

Explanation

Both statements are true: a virtual function must be a member of a class, and it is accessed through object pointers (base-class pointers) for run-time polymorphism. So neither is incorrect.

From DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021

This is question 96 of DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021. 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.