Another feature of object-oriented programming is the ability to reuse class definitions in order to simplify the creation of new classes. In other words, you can create more specialized versions of classes to deal with new types of object.
Because these derived classes share a number of features with existing classes, it makes sense to just extend the base, or parent class, rather than cut and paste the code into a completely new class. Added to this, if you change the underlying functionality of the base class, it is reflected in any classes that inherit from it.
There are a few points to remember when designing a class for inheritance:
Assignment operators are not inherited.
Constructors are not inherited.