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.

Multiple Inheritance

Actually, 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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the Difference between multiple inheritance and multilevel inheritance in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the similarities between java and c plus plus?

Java is related to C and C++ in the structure of programs composed with each language. All of them are object-oriented-programming languages (oop languages). Java is meant primarily for web apps C is meant primarily for programming servers C++ is meant primarily for large applications bbb


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.


Why is multiple inheritance implemened through interfaces?

Interfaces have only methods declared and not defined. So that these various methods can be altered or customized or written according to the need. Hence Multiple inheritance is implemented through Interfaces.Interface is a progam which just declares various methods or functions, so that any user can write the contents of that method declaration.AnswerTrue Multiple Inheritance refers to the ability to inherit from multiple CLASSES. Thus, a true multiple inheritance language does not use interfaces. However, many single-inheritance languages provide most of the benefits of the multiple inheritance concept by using interfaces (Java, for example). The problem with true Multiple Inheritance is twofold:(a) at the compiler and runtime level, it is often difficult to determine which method is being referred to, as M.I. can lead to very convoluted (and sometimes conflicting) namespaces(b) there is no specific superclass, which can lead to problems with determining relationships between classesUsing a S.I. model with interfaces avoids these two problems.


What is the difference between a nested IF and a multiple condition IFAND?

The difference is mainly in the way a compound condition is set out. A nested IF can be rewritten in terms of IFAND, and conversely.


Which type of inheritance does not support by java?

Desoola Anil Kumar, Java Faculty: There are 5 types of Inheritance. 1.Single inheritance, 2.Multiple inheritance, 3.Multilevel Inheritance, 4. Hirarichal inheritance and 5. Hybrid inheritance. Java supports multi level inheritance and hirarichal inheritance.

Related questions

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.


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 numbered text and multilevel numbered text?

1


The color of wheat grains shows variability between red and white with multiple phenotypeswhat is the inheritance pattern?

Polygenic inheritance


What is the difference between class inheritance and interface inheritance?

interface inheritance is a misleading term. Interface inheritance would be equivalent to the union of the method signatures of interfaces ( no typo here, an interface may implment multiple other interfaces) Class inheritance - single hierarchy (in C#), and not only the methods are inherited, but also the data members. (interface in C# cannot define data members)


Is there a difference between estate being willed to you or inheritance?

No. Property that you receive by a will IS an inheritance. Property received from a relative under the laws of intestacy when there was no will is also an inheritance.


What is the difference between sex-linked and maternal inheritance?

they have different meanings


difference between object and oriented program?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


What is the difference between pleiotropy and polygenic inheritance?

tatti kha meri kutey


What is the difference between cytosplasmic and mendelian inheritance?

To make this simple cytoplasmic inheritance is the inheritance of genes in organelles such as mitochondria that do not go through regular mitosis which is Mendelian inheritance. It is a bit more complex than this and can be easily Googled.


What types of inheritance in Java programming?

Java uses a hybrid system of inheritance. The designers chose a compromise between strict single inheritance and full multiple inheritance.See the related questions section below for more information.


What is the difference between finding a factor and finding a multiple?

a factor is what you multiply by a multiple is the answer