1.

Which among the following best describes the Inheritance?(a) Copying the code already written(b) Using the code already written once(c) Using already defined functions in programming language(d) Using the data and functions into derived segmentThis question was posed to me during an interview.My question comes from Inheritance in section Inheritance & its Types of Object Oriented Programming

Answer»

Correct choice is (d) Using the data and FUNCTIONS into derived segment

To explain I would say: It can only be indicated by using the data and functions that we USE in derived class, being PROVIDED by parent class. COPYING code is nowhere similar to this concept, also using the code already written is same as copying. Using already defined functions is not inheritance as we are not adding any of our own features.



Discussion

No Comment Found

Related InterviewSolutions