Inheritance and its Types Mcqs

Our collections of Multiple choice questions and answers focuses on study of Inheritance and its Types in OOP. These questions are chosen from a collection of most authoritative and best reference books on OOP. Our aim is to prepare an individual for competitive exams like NTS, Web Developer | IOS Developer | Game Developer | Software House interviews and jobs, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate Inheritance and its Types of OOP comprehensively.

1.
Which among the following best describes the Inheritance?

Copying the code already written

Using the code already written once

Using already defined functions in programming language

Using the data and functions into derived segment

3.
Which among the following best defines single level inheritance?

A class inheriting a derived class

A class inheriting a base class

A class inheriting a nested class

A class which gets inherited by 2 classes

4.
Which among the following is correct for multiple inheritance?

Class student{public: int marks,}s, class stream{int total,}, class topper:public student, public stream{ },

Class student{int marks,}, class stream{ }, class topper: public student{ },

Class student{int marks,}, class stream:public student{ },

Class student{ }, class stream{ }, class topper{ },

6.
Which among the following is correct for hierarchical inheritance?

Two base classes can be used to be derived into one single class

Two or more classes can be derived into one class

One base class can be derived into other two derived classes or more

One base class can be derived into only 2 classes

7.
Which is the correct syntax of inheritance?

Class derived_classname : base_classname{ /*define class body*/ },

Class base_classname : derived_classname{ /*define class body*/ },

Class derived_classname : access base_classname{ /*define class body*/ },

Class base_classname :access derived_classname{ /*define class body*/ },

10.
If a base class is inherited in protected access mode then which among the following is true?

Public and Protected members of base class becomes protected members of derived class

Only protected members become protected members of derived class

Private, Protected and Public all members of base, become private of derived class

Only private members of base, become private of derived class

12.
While inheriting a class, if no access mode is specified, then which among the following is true? (in C++)

It gets inherited publicly by default

It gets inherited protected by default

It gets inherited privately by default

It is not possible

13.
If a derived class object is created, which constructor is called first?

Base class constructor

Derived class constructor

Depends on how we call the object

Not possible

14.
How can you make the private members inheritable?

By making their visibility mode as public only

By making their visibility mode as protected only

By making their visibility mode as private in derived class

It can be done both by making the visibility mode public or protected

0Shares
0
Scroll to Top