Which of the following is/are feature(s) of inheritance in OOPs?
Features:
i) Sub Class
ii) Super Class
iii) Reusability
iv) Operator Overloading
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.