Which of the following statements regarding pure virtual functions in C++ is TRUE?
Which of the following statements regarding pure virtual functions in C++ is TRUE?
Multiple Choice Options
- A✓ Correct Option
They make the enclosing class abstract and are intended to be overridden in derived classes
- B
The
purekeyword must be explicitly written before the return type - C
They can never be called using qualified syntax even if an implementation is provided
- D
A class containing a pure virtual function can be directly instantiated
Detailed Technical Solution & Explanation
Declaring a pure virtual function (= 0) makes the class an abstract base class that cannot be directly instantiated. Its primary design purpose is to enforce an interface that must be implemented (overridden) by concrete derived classes.
Option Analysis:
pure keyword must be explicitly...): False; = 0 is used, not a pure keyword.Base): :foo().