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