Which of the following cannot be inherited ?

Answer : C. Destructor

Which of the following cannot be inherited ?

A. Friend

B. Static

C. Destructor

D. Constructor

Answer : C. Destructor

Explanation :

  • Friend Class – A friend class can access private and protected members of other class in which it is declared as friend. It is sometimes useful to allow a particular class to access private members of other class.
  • Constructor – A constructor is a member function of a class which initializes objects of a class. In C++, Constructor is automatically called when object (instance of class) create. It is special member function of the class.
  • Static – Static categories are sealed and thus can’t be transmissible. They can not inherit from any category except Object. Static categories cannot contain associate instance constructor. but, they will have a static builder.
  • Destructor – Destructor is a member function which destructs or deletes an object.
Leave a Reply

Your email address will not be published.