Posts

Inheritance In C++

Image
Inheritance In C++                 Introduction One of  the most  advantages of object oriented programming is reusability. Using already existing code is known as reusability. C++ supports reusability through inheritance which is creating  a replacement  class from already existing class . Inheritance is defined as deriving properties and behavior from one class  to a different  class. The existing class from which properties and behavior are derived  is understood  as a base class or super class. The new class into which the properties and behavior are derived  is understood  as a derived class or sub class. Inheritance  is additionally  referred to as  is-a relationship between classes. For example a Employee  may be a  Person and similarly Programmer  may be a  Person. Common properties and behavior of Employee and Programmer  are going to be  availa...