Machine-translated by Google. Questions are authored in English.
Top

Inheritance Questions and Answers

1.

Which of the following is/are feature(s) of inheritance in OOPs?

Features:
i) Sub Class
ii) Super Class
iii) Reusability
iv) Operator Overloading

Exam Year(s)

DSSSB TGT - 2023,

Answer: D

The features of inheritance are the sub class, the super class and reusability, so i, ii and iii only. A sub class inherits from a super class and so reuses its code. Operator overloading is a kind of polymorphism, in which an operator is given more than one meaning, and not a feature of inheritance, so iv is wrong, and the options with fewer items are incomplete. Inheritance lets the sub class take the data and methods of the super class and add its own, so code is written once and reused.

Please log in or register to report this question.

2.

The.............. inheritance supports the mechanism of deriving one base class with more than one derived classes.

Exam Year(s)

MH SET - 2018, SET Exam - 2018,

Answer: A

The answer is Hierarchical inheritance.

In hierarchical inheritance several derived classes inherit from one base class, for example Circle, Square and Triangle all derived from Shape. This is the case the question describes: one base class with more than one derived class.

Multiple inheritance is the reverse, one derived class with several base classes. Multilevel inheritance is a chain (A to B to C), and hybrid inheritance is a combination of two or more of these types.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Inheritance Questions and Answers || Inheritance MCQ Questions and Answers || Inheritance GK Questions and Answers || Inheritance GK MCQ Questions || Inheritance Multiple Choice Questions and Answers || Inheritance GK || GK on Inheritance || Object Oriented Programming Questions and Answers || Object Oriented Programming MCQ Questions and Answers || Object Oriented Programming GK Questions and Answers || GK on Object Oriented Programming