What is the reason that multiple inheritance is not possible
in java??

Answer Posted / gayathri

This is to avoid "Diamond problem"....Lets say there are 4 classes A,B,C,D..A is a superclass...The two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C? ...To avoid this issue, Java dint allow multiple inheritance..
Having said that, also note that Java allows multiple inheritance through multiple interface implementation

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is final variable?

501


What is a line break example?

580


Can inner class have constructor?

555


What are the five major types of reference sources?

543


what is the difference between Object Based Language and Object Oriented Language?

606






What is the difference between and ?

518


Tell me the latest versions in java related areas?

587


What do you understand by synchronization?

599


What is token in java?

535


How to find the index of the largest number in an arraylist java?

522


What are the 6 functions?

519


Which package has light weight components?

568


What is an image buffer?

543


What are checked exceptions?

586


What is used of static keyword in java?

594