Lec-14 Inheritance
Lec-14 Inheritance
Programming
Mohona Ghosh
Inheritance
• Inheritance is an important pillar of OOP
• It is the mechanism by which one class is allowed to inherit the
features of another class
• It allows us to create a new class (derived class) from an existing class
(base class).
Inheritance
Inheritance
Inheritance classes
• Base Class (or superclass): The class whose properties are inherited
by sub class is called Base Class or Super class.
• Derived Class (or subclass): The class that inherits properties from
another class is called Sub class or Derived Class.
Types of Inheritance
Defining
Derived
Classes
Defining Derived Classes