C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 40)
40.
Which of the following is not a type of inheritance?
Discussion:
8 comments Page 1 of 1.
Esk said:
4 years ago
Distributive is not Inheritance.
Yuvraj Kalamkar said:
4 years ago
Distributive inheritance/ Multipath Inheritance:
In this inheritance, a derived class is created from another derived class and the same base class of another derived class. This inheritance is not supported. NET Languages like C#, F#, etc.
For example, class D inherits the properties and behavior of class C and class B as well as Class A. Both class C and class B inherit Class A. So, Class A is the parent for Class B and Class C as well as Class D.
So it's making it Multipath inheritance or distributive inheritance. (Diamond problem where grandson inherits from grandfather as well as mother and father).
In this inheritance, a derived class is created from another derived class and the same base class of another derived class. This inheritance is not supported. NET Languages like C#, F#, etc.
For example, class D inherits the properties and behavior of class C and class B as well as Class A. Both class C and class B inherit Class A. So, Class A is the parent for Class B and Class C as well as Class D.
So it's making it Multipath inheritance or distributive inheritance. (Diamond problem where grandson inherits from grandfather as well as mother and father).
Rahul said:
7 years ago
Multilevel is the correct answer.
Abarna said:
9 years ago
Then, what is distributive inheritance?
Sudhanshu said:
1 decade ago
Forms Of Inheritance.
Single Inheritance: It is the inheritance hierarchy wherein one derived class inherits from one base class.
Multiple Inheritance:It is the inheritance hierarchy wherein one derived class inherits from multiple base class (es).
Hierarchical Inheritance: It is the inheritance hierarchy wherein multiple sub classes inherits from one base class.
Multilevel Inheritance: It is the inheritance hierarchy wherein subclass acts as a base class for other classes.
Hybrid Inheritance:The inheritance hierarchy that reflects any legal combination of other four types of inheritance.
As far as visibility is concerned: here it is.
Visibility Mode: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.
Private Inheritance: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.
Public 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. ;.
Protected 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.
Single Inheritance: It is the inheritance hierarchy wherein one derived class inherits from one base class.
Multiple Inheritance:It is the inheritance hierarchy wherein one derived class inherits from multiple base class (es).
Hierarchical Inheritance: It is the inheritance hierarchy wherein multiple sub classes inherits from one base class.
Multilevel Inheritance: It is the inheritance hierarchy wherein subclass acts as a base class for other classes.
Hybrid Inheritance:The inheritance hierarchy that reflects any legal combination of other four types of inheritance.
As far as visibility is concerned: here it is.
Visibility Mode: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.
Private Inheritance: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.
Public 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. ;.
Protected 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.
Rajasekhar said:
1 decade ago
Then what about the distributed inheritance? is their anything exists ?
Kalpana said:
1 decade ago
Distributive is not a type of inheritance.
Shaik abdul lateef said:
1 decade ago
Inheritance is the concept that contains five different types. So they are single, multiple, multi, hierarchy and hierachical. So there is no distributed inheritance.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers