Wednesday, 6 November 2019

what is inheritance?

An object can reuse the properties of other objects which belong to another class. It is known as inheritance. With inheritance we can reuse an existing class to build a new class. A new class or sub class shares common properties with the class from which it derived. A existing class is known as parent class and a new class is known as derived class. 
When a class inherits from one parent class is known as single inheritance but when derived class have more parent class it is called multiple inheritance. 

No comments:

Post a Comment