Multiple choice

Which of the following statements is TRUE regarding 'Pure Virtual Functions'?

  1. They are compulsory to be overloaded by the child class.

  2. Are optional to be overridden by the child class.

  3. A class containing a pure virtual function is just like a normal class.

  4. Cannot have arguments.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

 A pure virtual function is a function that is declared as virtual in the base class and redeclared in the child class. In the base class, its declaration ends with the '=0' symbol. It cannot be defined in the base class rather all the child classes must override (provide definition) the pure virtual function as per their requirements. If a derived class fails to override the pure virtual function, the compiler displays an error.