In: Computer Science
Inheritance is the way of accessing the members of a class by
another.
The class which allows its members to use is known as base class
and the class
which uses the members of base class is known as derived class. The
derived
class inherits all the capabilities of the base class and it can
also add some
more features to this class . Inheritance increases the code
reusability.
Inheritance in C++ are of six types such as
· Single Inheritance
· Multiple Inheritance
· Multilevel Inheritance
· Hybrid Inheritance
· Hierarchial Inheritance
· Multipath Inheritance
TYPES OF BASE CLASS
Any class can be used as a base class. A derived class may be defined as a base of another class. A base class can be classified as two different categories as
· Direct base class
· Indirect base class