Coupon Accepted Successfully!



  1. Inheritance is one of the most useful and essential characteristics of an object-oriented programming language. Inheritance allows the programmer to utilize the previously defined classes with newer ones. The new class is assembled using the properties of the existing classes.
  2. The procedure of developing a new class from an old class is termed inheritance.
  3. The new class is termed a derived class, and the old class is called a base class.
  4. Single inheritance: When a new class is derived from only one base class, such a type of inheritance is called a single inheritance.
  5. Multilevel inheritance: The procedure of deriving a class from a derived class is called multilevel inheritance.
  6. Multiple inheritance or hierarchical inheritance: When a class is derived from more than one class, this type of inheritance is called multiple inheritance or hierarchical inheritance.
  7. Hybrid inheritance: When a class is derived from another one or more base classes, this process is termed hybrid inheritance.
  8. When classes are declared virtual, the compiler takes essential caution to avoid duplication of member variables. Thus, we make a class virtual if it is a base class that has been used by more than one derived class as their base class.
  9. Execution of constructors in inheritance: The execution of constructors takes place from base class to derived class.
  10. Execution of destructors in inheritance: The execution of destructors is in opposite order as compared with constructors, that is, from derived class to base class.
  11. Public: If member variables of a class are public, any function can access them. In C++, the members of a struct and union are by default public.
  12. Private: If member variables of a class are private, member functions and friends can only access them, declared in a similar class. The members of a class are by default private.
  13. Protected: If member variables of a class are protected, its scope is similar to that for private functions. In addition, member functions and friends can use the member classes derived from the declared class, but only in objects of the derived type.
  14. When a class is not used for creating objects, it is called an abstract class.
  15. The constructor of the derived class works for its base class; such constructors are called common constructors.
  16. The derived class can have a similar function name as the base class member function. An object of the derived class invokes a member function of the derived class even if a similar function is preset in the base class.
  17. Properties of one class can be used in another class using inheritance or using the object of a class as a member in another class. Declaring the object as a class data member in another class is also known as delegation. When a class has an object of another class as its member, such a class is known as a container class.

Test Your Skills Now!
Take a Quiz now
Reviewer Name