Professional Documents
Culture Documents
Object-Oriented Programming (C++) Topic:-Inheritance
Object-Oriented Programming (C++) Topic:-Inheritance
(C++)
TOPIC:-INHERITANCE
2IT2(Batch-A)
Name : Mitul Kuvadiya(12202080701071)
Name : Meet Patel(12202080701066)
Name : Mitesh Bharwad (12202080701068)
DEFINITION
• Inheritance is the process, by which class can acquire the properties and
methods of another class.
• The mechanism of deriving a new class from an old class is called inheritance.
• The new class is called derived class and old class is called base class.
• The derived class may have all the features of the base class and the
programmer can add new features to the derived class.
TYPES OF INHERITANCE
1. Single Inheritance
2. Multilevel Inheritance
3. Multiple Inheritance
4. Hierarchical Inheritance
5. Hybrid Inheritance
SINGLE INHERITANCE
Class B
EXAMPLE OF SINGLE INHERITANCE
MULTILEVEL INHERITANCE
Class A A class is derived from a class which is derived from another class
then it is called multilevel inheritance.
Here, class C is derived from class B and class B is derived from class
Class B
A, so it is called multilevel inheritance.
Class C
EXAMPLE OF MULTILEVEL
INHERITANCE
MULTIPLE INHERITANCE
Class C
EXAMPLE OF MULTIPLE INHERITANCE
HIERARCHICAL INHERITANCE