Java / Inheritance
Types of inheritance.
Single Inheritance.
One class is extended by only one class.
Multilevel Inheritance.
One class is extended by a class and that class in turn is extended by another class thus forming a chain of inheritance.
Hierarchical Inheritance.
One class is extended by many classes.
Hybrid Inheritance.
It is a combination of above types of inheritance.
Multiple Inheritance.
It is a combination of above types of inheritance.
One class extends more than one classes. (Java does not support multiple inheritance.)
Through interfaces, we can implement multiple inheritance in java. As classes in java can not extend more than one classes, but a class can implement more than one interfaces
More Related questions...