Question 38Asked in UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)

Which of the following is not correct for virtual function in C++?

  1. AMust be declared in public section of class
  2. BVirtual function can be static
  3. CVirtual function should be accessed using pointers
  4. DVirtual function is defined in base class
Show answerHide answer

Correct answer: (B) Virtual function can be static

Explanation

A virtual function cannot be static, because a virtual function is a non-static member function whose call is resolved through a specific object at run time.

From UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions)

This is question 38 of UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions). 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.