INHERITANCEOBJECT ORIENTED PROGRAMMING
INDEX  Introduction  Derived class  visibility modes  Types of inheritance  Virtual base class  Constructors in derived classes
INHERITANCE  The mechanism of deriving a new class from an old class is called inheritance.  The old class is referred as base class and new one is called as derived class.  A new class inherits some or all properties from the base class.  Inheritance enables reusability.
TYPES OF INHERITANCE A B A B C A B C D C A B SINGLE INHERITANCE MULTILEVEL INHERITANCE MULTIPLE INHERITANCE HIERARCHICAL INHERITANCE
 Single inheritance: a derived class with only one base class is called single inheritance.  Multiple inheritance: a derived class with several base classes is multiple inheritance.  Multilevel inheritance: the mechanism of deriving a class from another derived class is known as multilevel inheritance.  Hiererchical inheritance: one class may be inherited by more than one class is known as hierarchical inheritance. TYPES OF INHERITANCE

Inheritance in Object Oriented Programming

  • 1.
  • 2.
    INDEX  Introduction  Derivedclass  visibility modes  Types of inheritance  Virtual base class  Constructors in derived classes
  • 3.
    INHERITANCE  The mechanismof deriving a new class from an old class is called inheritance.  The old class is referred as base class and new one is called as derived class.  A new class inherits some or all properties from the base class.  Inheritance enables reusability.
  • 4.
    TYPES OF INHERITANCE A BA B C A B C D C A B SINGLE INHERITANCE MULTILEVEL INHERITANCE MULTIPLE INHERITANCE HIERARCHICAL INHERITANCE
  • 5.
     Single inheritance:a derived class with only one base class is called single inheritance.  Multiple inheritance: a derived class with several base classes is multiple inheritance.  Multilevel inheritance: the mechanism of deriving a class from another derived class is known as multilevel inheritance.  Hiererchical inheritance: one class may be inherited by more than one class is known as hierarchical inheritance. TYPES OF INHERITANCE