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

Discussion

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

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

  • A.iii only
  • B.i and ii only
  • C.ii and iii only
  • D.i, ii and iii only

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.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.