Question

What is Inheritance? What is different type of inheritance? Explain how constructor is used in inheritance with the help of c++ program.

18 Oct 2017
Answer :
Word Count : 528

Inheritance is a process to create a new class from existing class or classes. Created new class is called sub class or child class or derived class and old class is known as parent class or super class or base class.

Advantage:

  • Code reusability
  • Function overriding
  • Save compilation and programmer time
  • Increase modularity

There are Five types of Inheritance:-

Single inheritance: - A class is derived from a Base class is called single inheritance class. Suppose Class ‘A’ is a base class and Class ‘B’ is derived from class ‘A’ then class ‘A’ is a super class and class ‘B’ is a sub class.

Image ignouacademy-com--p-inheritance-14872

Syntax:-

Class A

{

….

…..

};

Class B: public A

{

….

}

Multiple inheritances

A class is derived from more than one classes is called multiple inheritance. Here Class ‘A’ and Class ‘B’ are Base Classes and Class ‘C’ is derived from these two Base classes.

_________ _________ __________ _______ __________ ______ ____ _____ _______.
_______ ______ _______ ____ _________ __________ _____ _______ _____ _____.
______ ________ _______ ___ _________ ____.
______ _____ ______ _______ _______ ______ __________ __________ _________.
_______ ___ ________ ___ __________ ____ ________ ___ ___ _______.
_____ ____ ______ _______ ____.
__________ ________ ____ _______ ________ ___ _________ __________ _____ ________ _______ _________.
_______ __________ __________ __________ ________ _______ __________.
_________ _____ _________ _______ _____ ________ ________ ___ ________.
______ ________ _______ _________ _________.
___ ____ ___ __________ ________.
___ __________ _________ _________ _________.
_________ ____ ____ _______ ___ _______ ____.
_______ _____ ______ ___ ______.
___ _____ _____ _______ ________ ___ _________ _____.
___ _________ ______ ___ ____ _____ ________ ____ __________.
______ ___ _________ _______ ________ ______ __________ ________ ____ _________ ___ _________.
_______ ____ ____ ______ ____.
_______ ____ _______ ________ _________.
_____ ____ ____ ____ ________ __________ _________ ________ ________.
_____ _____ _____ ______ ______ ______ _________ ___ _____.
_______ _______ ________ ______ _______ ____ _____ __________ _________.
________ ______ ____ __________ _______ _______ ________ ______ ______.
________ _____ _______ __________ _________ _________ ______ __________ _______ _________ _________ ___.
_______ __________ _________ _______ _______ ___ __________.
___ ____ _________ _____ _______ _____ ___ ____ ______.
____ _________ __________ _______ __________ ________ ___ ______ _________.
____ ______ _________ ____ __________ ______ ________ ________ _________ ______.
______ _____ _____ _____ ______ _____.
_________ ________ _________ __________ ___ ______ ___ _______ __________ ____.
________ _________ _____ ________ ________ _________.
_____ _____ ___ ___ _____ _______ ___ ________ _______ __________ ________ ___.
____ __________ __________ ____ ________ _______ ______.
__________ _______ ____ ______ _________.
____ ____ _______ _________ ___ ___ ____ _________ ____ _______ _________.
__________ ___ ___ _____ _______.
_____ _______ ____ _______ _________ ___ ______ _________ _______.
________ _______ _________ ________ ______ __________ _________ _____ ____ _________.
______ ___ ________ _________ __________.
______ ______ ___ _____ ___ ________ _____ _____ __________ ________ __________ __________.
____ ______ ________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU BCS 31 2016 - What is Inheritance? What is different type of inheritance? Explain ho | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→