Thursday 28 April 2016

What is Inheritance?

Inheritance is a mechanism of deriving a new class form the existing old class.
The old class is referred as base class and new class is referred as the derived class.

New classes inherit some of the properties and behavior of the existing classes. An existing class that is "parent" of a new class is called a base class. New class that inherits properties of the base class is called a derived class.

So basically Inheritance is a technique of code reuse.

Please comment for any program related to Inheritance.

No comments:

Post a Comment