# 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 ?

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 ?

B. Hierarchical super positioning

C. Inheritance

D. Polymorphism

## 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.

## What is space complexity of the program ?

Answer : C. Amount of memory required by the program to run

## Given : integer x = 40, y = 35, z = 20, w = 10. Comment about the output of the following two statements ? print x * y / z – w print x * y / (z – w)

Answer : A. Differ by 80