|
NEW INTERVIEW QUESTIONS.COM
J2EE INTERVIEW QUESTIONS
JAVA INTERVIEW QUESTIONS DETAILS
NewInterviewQuestions.com - Home for World's Largest Interview Questions Website.
A D V E R T I S E M E N T
Question |
why there is no multiple inheritance in java ,what was the reason behind it? |
Answer
|
to avoid diamond problem of inheritance,java avoided multiple inheritance.Diamond problem : if two classes derive from samae class and another class dervies from these two classes,then there will be ambiguity as to decide whose properties to derive
Answered By: shanthi Date: 2/8/2008
To avoid the ambiguity which is resultant of multiple inheritance implementation.
Answered By: MOHAN G KUMAR Date: 2/11/2008
multiple inheritance is not used in java but we will use interface in java
Answered By: ff Date: 2/11/2008
in case of multiple inheritence,there is more than one superclass.In java,a class can not be subclassed of more than one superclass.For this reason,instead of multiple inheritence,java implements special feature which is interface.
Answered By: Supriya Pratihar Date: 2/15/2008
There is interface in java which provide all the features of multiple inheritance.
Answered By: priya Date: 2/15/2008
Java does not have multiple inheritance because when a sub class is derived from two super class, while referring to the method of the same name the keyword 'super' does not know which method to invoke.
Answered By: Anilvaj Date: 2/20/2008
java don't use the multiple inheritance beacuse there is problem
when we drive one class from two super classes then (if both super class have method of same name ) which method we call. to resolve this problem java use Interface .
Answered By: vineet Date: 4/18/2008
to avoid diamond problem of inheritance,java avoided multiple inheritance.Diamond problem : if two classes derive from samae class and another class dervies from these two classes,then there will be ambiguity as to decide whose properties to derive
Answered By: brijesh gupta Date: 5/31/2008
Reduce the complexcity & dimond problem. We can easily get the functionality of multiple inheritance by package
Answered By: brijesh gupta Date: 5/31/2008
© NewInterviewQuestions.com
|
If you have the better answer, than send it to us. We will display your answer after the approval.
Rate the above answer. Help us to know about the answer.
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
|
|
|