250+ TOP MCQs on Hybrid Inheritance and Answers

Object Oriented Programming (OOPs) Multiple Choice Questions & Answers (MCQs) on “Hybrid Inheritance”.

1. Which among the following best defines the hybrid inheritance?
a) Combination of two or more inheritance types
b) Combination of same type of inheritance
c) Inheritance of more than 7 classes
d) Inheritance involving all the types of inheritance
Answer: a
Clarification: When more than one type of inheritance are used together, it results in new type of inheritance which is in general known as hybrid inheritance. This may of may not have better capabilities.

2. How many types of inheritance should be used for hybrid?
a) Only 1
b) At least 2
c) At most two
d) Always more than 2
Answer: b
Clarification: There must be combination of at least 2 types of inheritance. The inheritance should be of different type.

3. If single inheritance is used with class A and B. A is base class. Then class C, D and E where C is base class and D is derived from C, then E is derived from D. Class C is made to inherit from class B. Which is the resultant type?
a) Single level
b) Multilevel
c) Hybrid
d) Multiple
Answer: b
Clarification: The statement represents multilevel inheritance. It is not hybrid since looking at complete idea, one can’t differentiate whether two type of inheritance are used. Hence it is multilevel inheritance.

4. Diamond problem includes ____________________ hybrid inheritance.
a) Hierarchical and Multiple
b) Hierarchical and Hierarchical
c) Multiple and Multilevel
d) Single, Hierarchical and Multiple
Clarification: The diamond problem arises when more than one classes are derived from one class and then those classes are used to derive single clas. Resulting in ambiguity of same functions from each class.

5. If __________________ inheritance is done continuously, it is similar to tree structure.
a) Hierarchical
b) Multiple
c) Multilevel
d) Hierarchical and Multiple
Answer: a
Clarification: Hierarchical inheritance is deriving more than one classes from a base class, it it is done continuously and subsequently, it results forming a tree like structure of classes being linked.

6. Which amongst the following is true for hybrid inheritance?
a) Constructor calls are in reverse
b) Constructor calls are priority based
c) Constructor of only derived class is called
d) Constructor calls are usual
Answer: d
Clarification: The constructors will be called in usual way. First the parent class Constructor and then the derived class Constructors. This is done to initialise all the members properly.

7. Which type of inheritance must be used so that the resultant is hybrid?
a) Multiple
b) Hierarchical
c) Multilevel
d) None
Answer: d
Clarification: The use of any specific type is not necessary. Though the final structure should not be the same, it should represent more than one type of inheritance if class diagram is drawn.

8. The private member’s are made public to all the classes in inheritance.
a) True
b) False
Answer: b
Clarification: The private member’s scope can’t be changed and those can never be accessed in other classes. Only the class containing private member’s can access its own members.

9. If hierarchical inheritance requires to inherit more than one class to single class, which syntax is correct? (A, B, C are class names)
a) hierarchical class A: public B, public C
b) multiple class A: public B, public C
c) many class A: public B, public C
d) class A: public B, public C
Answer: d
Clarification: The syntax is as same as declaration of other classes. There is no specific keyword defined for using hybrid inheritance in programming. Only thing is to specify the class name separated by commas.

10. What is the maximum number of classes allowed in hybrid inheritance?
a) 7
b) 127
c) 255
d) As many as required
Answer: d
Clarification: The classes in any type of inheritance can inherit as many classes as required. The only condition that may arise is memory management. The classes can inherit most of the features from more than one class.

11. What is the minimum number of classes to be there in a program implementing hybrid inheritance?
a) 2
b) 3
c) 4
d) No limit
Answer: d
Clarification: The answer is no limit. There is no condition defined for limit of classes that has to be used in hybrid. Though you must have at least 4 classes so that one set of multiple or hierarchical inheritance is there and one more class to use single level inheritance.

12. If object of lowest level class is created (last derived class) ________________ of its parent class constructors are called.
a) Few
b) All
c) Only parent and parent
d) Base and Derived
Answer: c
Clarification: When derived class object is created, all of its successor parent classes constructors are called. Constructor of all the connected classes is not created. Since the parent members have to be initialised, but other derived classes are not needed.

13. If hybrid inheritance is used, it mostly shows _______________ feature of OOP.
a) Flexibility
b) Reusability
c) Efficiency
d) Code readability
Answer: b
Clarification: The code is reusable in most of the classes and the data becomes more linked to other classes. Other features are also exhibited, but the code reusability is used the most. Code readability becomes relatively less. Flexibility increases but it depends on how the hybrid inheritance is used.

14. The sequence of destructors being called while using hybrid inheritance is ____________
a) Reverse of constructors being called
b) Reverse of classes being made
c) Reverse of objects being created
d) Reverse of code calling objects
Answer: a
Clarification: The destructors are always called in reverse order of constructors being called always. The type of inheritance doesn’t matter. The only important concept is the sequence of classes being inherited.

15. Overloading operators are possible only by using hybrid inheritance.
a) True
b) False
Answer: b
Clarification: The overloading concept is not related to the types of inheritance being used. Overloading operators can be done without using inheritance. You don’t even have to use more than one class for operator overloading.

Leave a Reply

Your email address will not be published. Required fields are marked *