Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more - View Single Post - OOPs
Thread: OOPs
View Single Post
Old 03-24-2010, 06:30 AM   #2 (permalink)
jakkevin4v
Junior Member
 
Join Date: Mar 2010
Posts: 17
Default Re: OOPs

In object-oriented programming (OOP), inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined. Inheritance is employed to help reuse existing code with little or no modification. The new classes, known as Sub-classes (or derived classes), inherit attributes and behavior of the pre-existing classes, which are referred to as Super-classes (or ancestor classes). The inheritance relationship of sub- and superclasses gives rise to a hierarchy. The inheritance concept was invented in 1967 for Simula.[1]

Inheritance should not be confused with (subtype) polymorphism, commonly called just polymorphism in object-oriented programming. Inheritance is a relationship between implementations, whereas subtype polymorphism is relationship between types (interfaces in OOP).[2] (Compare connotation/denotation.) In some, but not all OOP languages, the notions coincide because the only way to declare a subtype is to define a new class that inherits the implementation of another. Inheritance does not entail behavioral subtyping either. It is entirely possible to derive a class whose object will behave incorrectly when used in a context where the parent class is expected; see the Liskov substitution principle.
jakkevin4v is offline   Reply With Quote
Sponsored Links