Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


why is multiple inheritance not allowed in java?

Answers were Sorted based on User's Feedback



why is multiple inheritance not allowed in java?..

Answer / mahesh yadav ch

when ever a class extending more then one class. if f1()
method is present all exteding ... when we call f1()
method...jvm will confused which class method is called this
lead to ambuity error.....
java does'nt support multiple inheritance.......

Is This Answer Correct ?    19 Yes 3 No

why is multiple inheritance not allowed in java?..

Answer / haridini

Suppose if u inherit from multiple classes and in these
classes a method of same name exists then the class which
inherits from these classes gets confused that which one to
inherit. And this is also because of reducing complexity.
And above all u will get the multiple inheritance concept
in java through interfaced.

Is This Answer Correct ?    18 Yes 6 No

why is multiple inheritance not allowed in java?..

Answer / shahnawaz akhtar

bcoz of memory loss problem sun has not provide multiple
inheritance concept multiple inheritance is not achived in
java through class but we can achieve it by interface bcoz
interface only allow final static variable and abstract
method ,due to static variable it allocates memory only one
time so less memory is loss thats why sun has not provide
multiple inheritance concept through class

Is This Answer Correct ?    10 Yes 2 No

why is multiple inheritance not allowed in java?..

Answer / ganesh

When the multiple inheritance is allowed, means when a language allows the class to extend multiple classes, That leads to the ambiguity as to which class method to consider, when two of its parents have the same method signature. This is called Diamond ring problem

Is This Answer Correct ?    9 Yes 2 No

why is multiple inheritance not allowed in java?..

Answer / sikinder

Whenever one Sub Class Extends more than one classes, at
the time of creating that class object, JVM gets confused
to call the parent class constructor as well as methods.

To avoid this ambuiguity, java doesn't support multiple
inheritance

Is This Answer Correct ?    6 Yes 0 No

why is multiple inheritance not allowed in java?..

Answer / b.raja

pointers concept are not supported by java.and to reduce
the code redundency

Is This Answer Correct ?    7 Yes 16 No

why is multiple inheritance not allowed in java?..

Answer / ravikiran

because we cann't extend more than one class in java

Is This Answer Correct ?    5 Yes 16 No

Post New Answer



More Core Java Interview Questions

What is numeric promotion?

1 Answers  


What is Gang of four design patterns

0 Answers   Infosys,


what is j2se

3 Answers  


What does it mean that a method or field is “static”?

0 Answers  


What is the purpose of the runtime class in java programming?

0 Answers  






What are the different types of data structures in java?

0 Answers  


How do you bind variables?

0 Answers  


why the constructor should be used in class,if there is no constructor what will happen?

4 Answers  


How can I right-justify a string?

0 Answers   Aspire, Infogain,


What are different types of arrays?

0 Answers  


State two differences between C and Java.

0 Answers   Syntel, Visa,


Mention some interfaces implemented by linked list in java.

0 Answers  






Categories