why java not supproting multiple inheritance?

Answer Posted / aman kr. aggarwal

well as in c++ we have multiple inheritance, but not in java

becz if it is their then having method of same signature
(means same return type, list of paraments, access
specifiers) in 2 different classes and both r extended by
some class AA then while calling method in base class, it
would break down the jvm that to which classes method to be
called.
EX:-
class BB
{
public void a(int x)
{
System.out.println("call from BB");
}
}
class CC
{
public void a(int x)
{
System.out.println("call fro CC");
}
}
class AA extends BB,CC
{
a(5);
}

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstract class? Explain

806


What are keywords and reserved words in java?

810


What is a java lambda expression?

802


What does it mean to flush a file?

820


What is a function easy definition?

761


What is bool mean?

769


Is a char always 1 byte?

745


How does a for loop work?

764


What methodology can be utilized to link to a database?

736


What are the five major types of reference sources?

767


What do u mean by variable?

814


What does java final mean?

744


What is byte code and why is it important to java’s use for internet programming?

843


What is the difference between math floor and math round?

741


How do you know if a value is nan?

819