Wednesday, July 15, 2009

Inheritance

In object-oriented programming, inheritance is a way to form new classes instances of which are called objects using classes that have already been defined. Inheritance provides the support for representation by categorization in computer languages.  

An advantage of inheritance is that modules with sufficiently similar interfaces can share a lot of code, reducing the complexity of the program. The new classes, known as derived classes, take over attributes and behavior of the pre-existing classes, which are referred to as base classes. 

Categorization is a powerful mechanism number of information processing, crucial to human learning by means of generalization what is known about specific entities is applied to a wider group given a belongs relation can be established and cognitive economy less information needs to be stored about each, only its particularities.

Inheritance therefore has another view, a dual, called polymorphism, which describes many pieces of code being controlled by shared control code.Inheritance is typically accomplished either by overriding one or more methods exposed by ancestor, or by adding new methods to those exposed by an ancestor.

No comments:

Post a Comment