MADE BY:
PREETI BAJARE
ROLL NO.:
5705
What is Inheritance ?
Inheritance is one of the important
feature of the OOP. Inheritance is the
method by which objects of one class
gets the properties of another class.
Advantages of Inheritance?
Sometimes we need to repeat the code or
we need repeat the whole class properties.
So It helps in various ways.
1.) It saves memory space.
2.) It saves time.
3.) It will remove frustration.
4.) It increases reliability of the code
5.) It saves the developing and testing
efforts.
Why we use Inheritance?
To increase the reusability of the
code and to make further usable for
another classes. We use the concept
of inheritance.
Types of Inheritance
1.) Single Inheritance
2.) Multiple Inheritance
3.) Multilevel Inheritance
3.) Hierarchical Inheritance
4.) Hybrid inheritance
 A derived class with only one base class.
A
B
 A derived class with several base classes.
A
C
B
 The mechanism of deriving a class from
another derived class.
A
C
B
Student
Test
Records
Result
Sports
Intermediate
base class
Derived
class
Base
class
The method of combining any two or more forms of
inheritance in single form is called hybrid inheritance.
 A derived class can be defined by specifying
its relationship with the base class in addition
to its own details.
class derived-class-name : visibility-mode base-class-name
{
………//
………// members of derived class
………//
};
It is the keyword that controls the visibility
and availability of inherited base class
members in the derived class. It can be either
private or protected or public.
It is the inheritance facilitated by private
visibility mode. In private inheritance, the
protected and public members of base
class become private members of the
derived class.
Private Inheritance:
It is the inheritance facilitated by public
visibility mode. In public inheritance, the
protected members of base class
become protected members of the
derived class and public members of the
base class become public members of
derived class.;
Public Inheritance:
It is the inheritance facilitated by
protected visibility mode. In
protected inheritance , the protected
and public members of base class
become protected members of the
derived class.
Protected Inheritance:
Inheritance

Inheritance

  • 1.
  • 2.
    What is Inheritance? Inheritance is one of the important feature of the OOP. Inheritance is the method by which objects of one class gets the properties of another class.
  • 3.
    Advantages of Inheritance? Sometimeswe need to repeat the code or we need repeat the whole class properties. So It helps in various ways. 1.) It saves memory space. 2.) It saves time. 3.) It will remove frustration. 4.) It increases reliability of the code 5.) It saves the developing and testing efforts.
  • 4.
    Why we useInheritance? To increase the reusability of the code and to make further usable for another classes. We use the concept of inheritance.
  • 5.
    Types of Inheritance 1.)Single Inheritance 2.) Multiple Inheritance 3.) Multilevel Inheritance 3.) Hierarchical Inheritance 4.) Hybrid inheritance
  • 6.
     A derivedclass with only one base class. A B
  • 7.
     A derivedclass with several base classes. A C B
  • 8.
     The mechanismof deriving a class from another derived class. A C B
  • 10.
    Student Test Records Result Sports Intermediate base class Derived class Base class The methodof combining any two or more forms of inheritance in single form is called hybrid inheritance.
  • 11.
     A derivedclass can be defined by specifying its relationship with the base class in addition to its own details. class derived-class-name : visibility-mode base-class-name { ………// ………// members of derived class ………// };
  • 12.
    It is thekeyword that controls the visibility and availability of inherited base class members in the derived class. It can be either private or protected or public.
  • 13.
    It is theinheritance facilitated by private visibility mode. In private inheritance, the protected and public members of base class become private members of the derived class. Private Inheritance:
  • 14.
    It is theinheritance facilitated by public visibility mode. In public inheritance, the protected members of base class become protected members of the derived class and public members of the base class become public members of derived class.; Public Inheritance:
  • 15.
    It is theinheritance facilitated by protected visibility mode. In protected inheritance , the protected and public members of base class become protected members of the derived class. Protected Inheritance: