-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path35inheritance.cpp
More file actions
23 lines (21 loc) · 1003 Bytes
/
Copy path35inheritance.cpp
File metadata and controls
23 lines (21 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Inheritance is a property of OOPs that allows a class to inherit the properties of another class.
//the class that is the main class providing inheritance is called the base class and the inheriting classes are called derived class.
/*
Types of inheritance :
1) Single inheritance : A single class derives a class or a single class is derived from a single class.
[_] --> [_]
2) Multiple inheritance : A single class is derived from multiple base classes or multiple class derives a single class.
[_]
| --> [_]
[_]
3) Hierarchical inheritance : A single base class derives many classes or many classes are derived from a single class.
|--> [_]
[_]--|
|--> [_]
4) Multi-level inheritance : A chain of classes being derived from a base first then from successive derived classes.
[_] --> [_] --> [_]
5) Hybrid inheritance : Combination of multiple, hierarchical and multi-level inheritance.
|--> [_]
[_]--| ]--> [_]
|--> [_]
*/