1.

Define the term inheritance.

Answer»

Inheritance is a mechanism in which a new class is derived from an already defined class. The derived class is known as a subclass or a child class. The preexisting class is known as base class or a parent class or a super class. The mechanism of inheritance gives rise to hierarchy in classes. The major purpose of inheriting a base class into one or more derived class is code reuse. The subclass inherits all the methods and properties of the super class.



Discussion

No Comment Found