Multiple choice

Choose the appropriate true statement among the given options with reference to C++ programming.

  1. Friend function of a class cannot access private members of the given class.

  2. It is not mandatory to have a pure virtual function(s) in an abstract class.

  3. We can create object for an abstract class.

  4. If a class inherits abstract class and doesn't implement pure virtual functions of base class, then derived class also becomes abstract class.

  5. None of the above

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

This option is true because the derived class doesn't implement all pure virtual functions of the abstract class(base class) it turns to abstract class itself. Again we have to inherit the derived class to another derived class where we must implement all the pure virtual functions. If we don't implement at present derived class it also turn out to abstract class. Finally an abstract class should be followed by a class where all implementations of pure virtual functions are done completely.