OOPS Concepts

Q1:
Which inheritance type is used in the class given below?
class A : public X, public Y
{}

A Hybrid inheritance

B Multiple inheritance

C Multilevel inheritance

D Hierarchical Inheritance

ANS:A - Multilevel inheritance

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.  



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.