Polymorphism – It is the ability for a message or data to be processed in more than one form.An operation may exhibit different behaviors in different instances. The behavior depends on the data types and number of data items used in the operation. Polymorphism is implemented using function overloading.

For example –

class Kangra

{

public:

Kangra()

{ }

int area(int a)

{

return a*a;

}

int area( int a,int b); //Overloaded function

{

return a*b;

}

};

Inheritance – Inheritance is the process by which objects of one class can acquire the properties of objects of other class.

Inheritance provides code re-usability, like, adding additional features to an existing class without modifying it. This is achieved by deriving new class from the existing one. The new class will have combined features of both the classes.