Inheritance is the
transmission of genetically controlled characteristics or qualities from parent
to offspring. It is a type of relationship among generations, in which one
generation shares the structure or behaviour defined in one (single
inheritance) or more (multiple inheritance) other generations. Inheritance
defines a "kind of" hierarchy among classes in which a sub class
inherits from one or more super-classes; a sub-class typically improves or
redefines the existing structure and behaviour of its super-classes.
A sub-class is a specialization of its parent
class. All sub-classes inherit the super-class traits & operations. Each
sub-class has unique traits and operations. A sub-class may override features
of a parent class by defining one with the same name.
The concept of inheritance is used in the context of object
oriented modelling. Its key objective is to reduce the redundancy in object
models by arranging classes with similar attributes and operations in a hierarchy.
(left picture. A picture of inheritance/heredity)
No comments:
Post a Comment