answersLogoWhite

0


Best Answer

Multilevel Inheritance

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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Class hierarchies and multiple level of inheritance?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Specification forms of inheritance in java?

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.


Type of inheritance?

There are 2 Types of genetic Inheritance. 1. Polygenic inheritance, also known as quantitative or multi-factorial inheritance refers to inheritance of a phenotypic characteristic (trait) that is attributable to two or more genes and their interaction with the environment. Polygenic traits do not follow patterns of Mendelian inheritance (qualitative traits). Instead, their phenotypes typically vary along a continuous gradient depicted by a bell curve. Eye color and skin color are both polygenetic traits. 2. Monogenic inheritance is controlled by a single gene, as opposed to multigenic.


Why does Java support multilevel inheritance?

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.


Inheritence and its types in object oriented programmings?

There are only two types of inheritance in object oriented programming: Single inheritance: where a class inherits directly from just one base class. Multiple inheritance: where a class inherits directly from two or more base classes. Multi-level inheritance is often thought of as being a separate type of inheritance, however inheritance relates to a derived class and those that it directly inherits from. If a base class is itself a derived class (an intermediate class), then its base class or classes are simply indirect base classes of the derivative. But in isolation, the intermediate class either uses single or multiple inheritance, even if its base class or classes are also intermediates. Virtual inheritance is also thought of as being a separate type, however virtual inheritance doesn't change the relationship between classes within the hierarchy. the only difference virtual inheritance makes is that the virtual base class or classes are constructed by the most-derived class within the current hierarchy, rather than by their most direct descendants. In this way, only one instance of each virtual base exists in the hierarchy, rather than multiple instance as would normally exist. The actual inheritance is still single or multiple, however.


Java program to demonstrate multiple inheritance?

Inheritance is one of the building blocks of Java and it is used extensively in all java based applications. Inheritance is everywhere in Java. I can't think of one java project that I worked on, where inheritance wasn't used. Inheritance is the feature wherein the properties/qualities of a parent class or interface is used in the child class. Both Classes & Interfaces are used in Java Inheritance

Related questions

What is the Difference between multilevel and multiple inheritance?

Multiple Inheritance : we can inherit more than one class in the same class. Multi-Level Inheritance: where one class can inherit only one base class and the derived class can become base class of some other class.


What is the Difference between multiple inheritance and multilevel inheritance in asp.net?

Multiple inheritance, as the name 'multiple' suggests, is one where more than one(multiple) super class is inherited by one sub-class. It can be represented as:A B C\ | /DOn the other hand, in case of multilevel inheritance; the superclass is inherited by a sub-class which is in turn inherited by another class leading to the different level. It can be represented as:A|B|CHowever in asp, multiple inheritance is not supported.


Specification forms of inheritance in java?

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.


Type of inheritances in c plus plus?

Single, multiple, multi-level, hierarchical and hybrid/virtual inheritance. Single inheritance applies when one class inherits from just one base class. Multiple inheritance applies when one class inherits from two or more base classes. Multi-level inheritance applies to a class that inherits from at least one base class that is itself derived from another base class. Hierarchical inheritance applies to a base class that is inherited by two or more separate derived classes. Hybrid inheritance combines multiple inheritance, multi-level inheritance and hierarchical inheritance. That is, where A is a common base class of derived classes B and C, and B and C are both base classes of derived class D. Hybrid inheritance is often used with virtual inheritance where B and C inherit from A virtually rather than directly. In these cases, the virtual base class is instantiated by the most-derived class in the hierarchy, D, and this instance is then shared by both B and C.


What is public inheritance in java?

Inheritance is a Java feature by which we can reuse code and programming logic from one class in another class. We implement Inheritance using the extends keyword.Ex: public class Ferrari extends Car {…}Here the Ferrari Class will extend features from the Car Class.This is Inheritance. The different types of Inheritance are:Single InheritanceMulti-Level InheritanceMultiple Inheritance (Java supports only Partial Multiple Inheritance) andHybrid Inheritance


What is multiple inheritance?

A class which inherits from more than one super-classes is said to implement multiple inheritance.For example, a simple class hierarchy might define a vehicle class. Decedents of the vehicle class could be car, ship and aeroplane classes. Another root-level class could be the class of landbound things. Using multiple inheritance, the car class might be derived from both vehicle and landbound things.


Type of inheritance?

There are 2 Types of genetic Inheritance. 1. Polygenic inheritance, also known as quantitative or multi-factorial inheritance refers to inheritance of a phenotypic characteristic (trait) that is attributable to two or more genes and their interaction with the environment. Polygenic traits do not follow patterns of Mendelian inheritance (qualitative traits). Instead, their phenotypes typically vary along a continuous gradient depicted by a bell curve. Eye color and skin color are both polygenetic traits. 2. Monogenic inheritance is controlled by a single gene, as opposed to multigenic.


Why does Java support multilevel inheritance?

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.


Inheritence and its types in object oriented programmings?

There are only two types of inheritance in object oriented programming: Single inheritance: where a class inherits directly from just one base class. Multiple inheritance: where a class inherits directly from two or more base classes. Multi-level inheritance is often thought of as being a separate type of inheritance, however inheritance relates to a derived class and those that it directly inherits from. If a base class is itself a derived class (an intermediate class), then its base class or classes are simply indirect base classes of the derivative. But in isolation, the intermediate class either uses single or multiple inheritance, even if its base class or classes are also intermediates. Virtual inheritance is also thought of as being a separate type, however virtual inheritance doesn't change the relationship between classes within the hierarchy. the only difference virtual inheritance makes is that the virtual base class or classes are constructed by the most-derived class within the current hierarchy, rather than by their most direct descendants. In this way, only one instance of each virtual base exists in the hierarchy, rather than multiple instance as would normally exist. The actual inheritance is still single or multiple, however.


Java program to demonstrate multiple inheritance?

Inheritance is one of the building blocks of Java and it is used extensively in all java based applications. Inheritance is everywhere in Java. I can't think of one java project that I worked on, where inheritance wasn't used. Inheritance is the feature wherein the properties/qualities of a parent class or interface is used in the child class. Both Classes & Interfaces are used in Java Inheritance


How many class of Hierarchical Inheritance?

There are 2 main types of Hierarchical Inheritance - Single and Multi Level Class A extends Class B - Single Class A extends Class B which in turn extends Class C - Multi level. Actually there is no limit to the number of levels till which you can inherit classes in multi level inheritance. But it is preferable to keep it at around 3 or 4 for ease of maintenance and understanding.


What is multilevel inheritance in C plus plus?

Multi-level inheritance involves at least 3 classes, a, b and c, such that a is derived from b, and b is derived from c. c is therefore the least-derived base class, b is an intermediate base class and a is the most-derived class.