This section contains 1,036 words (approx. 4 pages at 300 words per page) |
Inheritance is a feature of some but not all object-oriented computer programming languages. Inheritance describes the situation when a programmer creates a new class and bases it on an old one. The new class is said to be a "derived class" or "subclass" of the old one, which is often termed the "base class" or the "superclass."
In languages that support inheritance, the derived class is said to be a "kind of" the base class in an "is a" relationship. And by being a "kind of" the base class, the derived class includes all the data, methods, and characteristics of its base class; the programmer's job is then to refine the behavior of the base class to make it more like the thing it represents.
For example, if a Mastiff class is derived from a Dog class, then a Mastiff is a "kind of" Dog, in...
This section contains 1,036 words (approx. 4 pages at 300 words per page) |