answersLogoWhite

0

If a single class inherits from two other classes, each of which has the same function implemented, how can we tell which one to call? This ambiguity often leads to non-deterministic behavior of classes in multiple inheritance languages.

User Avatar

Noemy Grady

Lvl 10
3y ago

What else can I help you with?

Continue Learning about Engineering

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 { ... .... ...... }


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.


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

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 { ... .... ...... }


What is ambiguity in multiple inheritance?

Java does not support multiple inheritance


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.


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.


Disadvantages of the patrilineal inheritance system?

The patrilineal inheritance system has several disadvantages, including: Gender Inequality Family Conflicts Disinherited Children Inefficient Resource Allocation Inflexibility


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.


Which two terms best describe the inheritance of human blood types?

Mendelian inheritance, multiple alleles.


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.