Coupon Accepted Successfully!



Inheritance is one of the most useful and essential characteristics of object-oriented programming. The existing classes are the main components of inheritance. The new classes are created from existing ones. The properties of the existing classes are simply extended to the new classes. The new classes created by using such a method are known as derived classes, and the existing classes are known as base classes, as shown in Figure (Inheritances). The relationship between the base and derived classes is known as kind of relationship. The programmer can define new member variables and functions in the derived class. The base class remains unchanged. The object of the derived class can access members of the base as well as derived classes. On the other hand, the object of the base class cannot access members of the derived classes. The base class does not know about their subclasses.

Fig. Inheritances

Test Your Skills Now!
Take a Quiz now
Reviewer Name