Because it is one of the most important and widely used inheritance concepts in Java. In multi level inheritance a class directly inherits features from one class and indirectly inherits features form other classes that are in the inheritance hierarchy.
Multilevel inheritance is when there is a multiple father child hierarchy in your application.
Ex:
class A extends class B
class B extends class C
class C extends class D
This means class A extends class D indirectly through classes B and C.
Java does not support multiple inheritance.......
single level inheritance eg ( class B extends Class A) Multilevel inheritance eg( class C extends class B and class B extends class A) multiple inheritance Class C inherits Class A features as well as Class B featues.This type of inheritance is not allowed in JAVA.
Java does not support multiple inheritance. It is done with the help of interfaces in java. a class can implement n number of interfaces, thus showing multiple inheritance. but a class cannot extend multiple classes in java.
Multilevel InheritanceA Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.Ex: public class Automobile {…}Public class Car extends Automobile {…}Public class Ferrari extends Car {…}This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.Multiple InheritanceActually, java does not support multiple inheritance. You can achieve partial multiple inheritance using interfaces but java is not like C or C++ where you can do direct multiple inheritance. However, you can achieve partial multiple inheritance with the help of interfaces.Ex: public class FerrariF12011 extends Ferrari implements Car, Automobile {…}And this is under the assumption that Car and Automobile are interfaces.Here if you see, though you don't inherit concrete code from the Car or the Automobile interface, you do inherit skeleton methods that determine the way your class eventually behaves and hence this can be considered partial Multiple Inheritance.
Multilevel InheritanceA Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.Ex: public class Automobile {…}Public class Car extends Automobile {…}Public class Ferrari extends Car {…}This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number
Java does not support multiple inheritance.......
In java we can implement more than one interfaces for a single class but we can't extend a class to more than one super class so ,java indirectly supports multiple inheritance.
Java does not support multiple inheritance
Java does not support direct multiple Inheritance. Harder to implement, not every language support it: C++ does, Java does not.
Inheritance refers to the concept by which the features from one class can be extended/made available in other classes. Java supports 3 forms of inheritance * Single Inheritance * Multiple Inheritance * Multilevel Inheritance (Can be implemented using interfaces)
single level inheritance eg ( class B extends Class A) Multilevel inheritance eg( class C extends class B and class B extends class A) multiple inheritance Class C inherits Class A features as well as Class B featues.This type of inheritance is not allowed in JAVA.
Multilevel InheritanceA Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.Ex: public class Automobile {…}Public class Car extends Automobile {…}Public class Ferrari extends Car {…}This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.
Single Inheritance Multiple Inheritance Multilevel Inheritance
Java does not support multiple inheritance. It is done with the help of interfaces in java. a class can implement n number of interfaces, thus showing multiple inheritance. but a class cannot extend multiple classes in java.
Multilevel InheritanceA Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.Ex: public class Automobile {…}Public class Car extends Automobile {…}Public class Ferrari extends Car {…}This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.Multiple InheritanceActually, java does not support multiple inheritance. You can achieve partial multiple inheritance using interfaces but java is not like C or C++ where you can do direct multiple inheritance. However, you can achieve partial multiple inheritance with the help of interfaces.Ex: public class FerrariF12011 extends Ferrari implements Car, Automobile {…}And this is under the assumption that Car and Automobile are interfaces.Here if you see, though you don't inherit concrete code from the Car or the Automobile interface, you do inherit skeleton methods that determine the way your class eventually behaves and hence this can be considered partial Multiple Inheritance.
Multilevel InheritanceA Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.Ex: public class Automobile {…}Public class Car extends Automobile {…}Public class Ferrari extends Car {…}This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number
A Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class. Ex: public class Automobile {…} Public class Car extends Automobile {…} Public class Ferrari extends Car {…} This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.