Tarun works all night long writing code and writing more and more classes for each object he now thinks that he can write a superclass which defines some hierarchical feature for other classes, what can he use ?

A. Cascading

B. Hierarchical super positioning

C. Inheritance

D. Polymorphism

Answer : C. Inheritance

Explanation :

  • In object-oriented programming, inheritance is that the mechanism of basing an object or category upon another object (prototypical inheritance) or category (class-based inheritance), holding similar implementation.

Categorized in: