Inheritance

By: aathishankaran Viewed: 153175 times  Printer Friendly Format    


Inheritance

 

Inheritance is the process by which one object acquires the properties of another object. This is important because it supports the concept of inheritance classification. As mentioned, most knowledge is made manageable by hierarchical classification.

For example, a Golden Retriever is part of the classification dog, which is turn part of the mammal class, which is under the larger class animal. Without the use of hierarchies, each object would need to define all of its characteristics explicitly.

However, by use of inheritance, an object need only define those qualities that make unique within its class. It can inherit its general attributes from its parent. Thus, it is the inheritance mechanism that makes it possible for one object to be a specific instance of a more general case.

Inheritance interacts with encapsulation as well. If a given class encapsulates some attributes, than any subclass will have the same attributes plus any that it adds as part of its specification.

 

Mainly the inheritance property of java is used to derive the properties of super class. By using this inheritance we can inherits the property of the super class to child class it will reduce more redundancy of code.



Most Viewed Articles (in Java )

Latest Articles (in Java)

Comment on this tutorial