2. inheritance it is a mechanism in which one class
inherits the property of other class is know as
inheritance
OR
when one class can access the property of
another class
Ex--> father & son
inheritance
4. Single inheritance
A class which contains only
one base class and only one
derive class is called single
inheritance
derive
base
Student
exam
5. Multi-level inheritance
child class1
Base class
child class2
When a base class is derived by a child
class which further derived by another
child class then it is known as multi level
inheritance
depositor
cutomer
borrower
6. Multiple -inheritance
Base 2
Base class 1
derive class
Base n
When more than one base class
are inherited by a derived class
,then such type of inheritance is
called as multiple inheritance
Example :- a child & father
7. Hierarchical inheritance
Derive 1 derive2
base
When one base class is inherited by more
then one derived class , it is known as
hierarchical inheritance,
In this many programing problems can be
cast into a hierarchical where certain
features of one level are shared by many
others below that level
Derive class n
Full time Part time
employee