answersLogoWhite

0


Best Answer

dvantages of multiple inheritances:
· Multiple inheritance allows a class to inherit the functionality of more than one base class thus allowing for modeling of complex relationships


· You categorize classes in many ways. Multiple inheritance is a way of showing our natural tendency to organize the world. During analysis, for example, we use multiple inheritance to capture the way users classify objects.


· By having multiple super-classes, your subclass has more opportunities to reuse the inherited attributes and operations of the super-classes.


Disadvantages of multiple inheritances:
· Some programming languages (such as Java) do not allow you to use multiple inheritances. You must translate multiple inheritance into single inheritance or individual java interfaces. This can be confusing and difficult to maintain because the implemented code for categorizing objects is quite different fro the way the user organizes those objects. So, when the user changes their mind or adds another category, it is difficult to figure out how to program the new sub classes.


· The more super classes your sub class inherits from the more maintenance you are likely to perform. If one of the super classes happens to change, the sub class may have to change as well.


· When a single sub class inherits the same attribute or operation form different super classes, you must choose exactly which one it must use.


Multiple inheritances can cause a lot of confusion, say when both the classes from which you want the child class to inherit from, has a method with same


Muhammad Shahbaz


Linux Administrator




Other Responses:


The Eiffel language and method was designed from the ground up to have multiple inheritance without ANY of the `gotchas' of languages like Java, C++ and others. The `disadvantages' listed above have nothing to do with MI, but with the technique and technologies listed (e.g. Java or C++). When MI is designed thoughtfully into a language and method, then the `dangers' or `disadvantages' are not there. As an Eiffel engineer, we use MI extensively, safely and beneficially all the time.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Advantages of multiple inheritance in UML?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Give the structure of multiple 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.


How can you write multiple inheritance program in java?

Java does not support direct multiple inheritance. You can implement partial multiple inheritance using interfaces. ex: public class ExMultInherit implements interface1, interface2, interface 3 { ... .... ...... }


Drawbacks of multiple inheritance in c plus plus?

There are no drawbacks to multiple inheritance if multiple inheritance is precisely what is required to achieve your goal. If there are any drawbacks then it is only because of poor design, not multiple inheritance itself. For instance, when designing classes to simulate vehicles, an amphibious vehicle would inherit the properties of both an off-road vehicle and a marine vehicle, therefore multiple inheritance would be an appropriate usage.


Does hybrid inheritance consist of ANY two types of inheritance?

There are only two types of inheritance to begin with: single inheritance and multiple inheritance. Since they are mutually exclusive there is no such thing as hybrid inheritance.


How ploymorphism and inheritance is different from that in Java and c plus plus?

C++ allows multiple inheritance while Java does not. In my opinion, multiple inheritance is not useful because it can get very confusing very quick. For polymorphism, C++ does early binding by default, while Java does late binding by default. Late binding is more useful than early binding.

Related questions

What are the advantages of multiple inheritance over single inheritance?

The advantages of multiple inheritance over single inheritance include being a realistic software model. It is useful in breaking down complicated behavior into sets of characteristics that does not interfere with one another.


Advantages and disadvantages of uml?

The advantages of UML includes the ability to be used to model most types of applications and also generate test scripts apart from stub code. The biggest disadvantage of UML, is that it does not define a standard file format, which places limitations on the software capabilities.


What is ambiguity in multiple inheritance?

Java does not support multiple inheritance


How is UML related to OOAD?

UML supports Object Oriented Analysis and Design (OOAD). It has all related concepts like classes, objects, inheritance, encapsulation, polymorphism, etc. UML is most suitable for use case driven, iterative and incremental development processes as most OOAD processes are.


Different types of inheritances?

Single Inheritance Multiple Inheritance Multilevel Inheritance


What type of inheritance pattern are these rabbits likely displaying?

Types of dominance, multiple alleles, sex linked inheritance, polygenic inheritance and maternal inheritance.


Give the structure of multiple 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.


What kind of inheritance is not allowed in java?

Java does not allow the multiple inheritance of concrete classes, though it does allow a "hybrid" inheritance of one concrete class and multiple interfaces.


How can you write multiple inheritance program in java?

Java does not support direct multiple inheritance. You can implement partial multiple inheritance using interfaces. ex: public class ExMultInherit implements interface1, interface2, interface 3 { ... .... ...... }


Drawbacks of multiple inheritance in c plus plus?

There are no drawbacks to multiple inheritance if multiple inheritance is precisely what is required to achieve your goal. If there are any drawbacks then it is only because of poor design, not multiple inheritance itself. For instance, when designing classes to simulate vehicles, an amphibious vehicle would inherit the properties of both an off-road vehicle and a marine vehicle, therefore multiple inheritance would be an appropriate usage.


Why is multiple inheritance not possible in C?

C is not object-oriented -- you can't even use single inheritance let alone multiple inheritance.


What is problem in multiple inheritance?

Java does not support direct multiple Inheritance. Harder to implement, not every language support it: C++ does, Java does not.