1.

What is inheritance? Discuss its various forms.

Answer»

Inheritance is the capability of one class to inherit properties from another class. Forms of Inheritance:

1. Single Inheritance: One base class and one super class.

2. Multiple Inheritance: Multiple base class and one sub class.

3. Hierarchical Inheritance: One base class and multiple sub class.

4. Multi-level Inheritance: A subclass inherits from a class that itself inherits from another class.

5. Hybrid Inheritance: A subclass inherits from multiple base classes and all of its base classes inherit from a single base class.



Discussion

No Comment Found

Related InterviewSolutions