why java does not support multiple inheritance

Answers were Sorted based on User's Feedback



why java does not support multiple inheritance..

Answer / neeraj kumar singh

in multiple inheritance there are a number of base class so
when ever we use super keyword to call any method then
compiler do not recognize the base class form which property
and method have to use.since there is only one way to call
base class method and property which is super keyword. so
because of super keyword, java do not support multiple
inheritance but it is possible with help of interface.

Is This Answer Correct ?    0 Yes 1 No

why java does not support multiple inheritance..

Answer / jitesh singh

java support multiple inheritance though multiple interface inheritance but multiple interface inheritance allows an object to inherit many different method signatures with the warning that the inheriting object must implement those inherited methods.Thus,The inheriting object just doesn't get an implementation free ride.

Is This Answer Correct ?    0 Yes 1 No

why java does not support multiple inheritance..

Answer / deepak garg

multiple inheritence are simply use in java but if we use
this facility to java we are face to a mixup problem
because same name same argument confusion create and so we
are not use in multiple inheritence.

Is This Answer Correct ?    1 Yes 3 No

why java does not support multiple inheritance..

Answer / anoop

java do not support virtual keyword ,therefore direct
multiple inheritance is not supported in java

Is This Answer Correct ?    0 Yes 2 No

why java does not support multiple inheritance..

Answer / rajib

class ConcreteClaNm extends SuperClass{}
or
class ConcreteClaNm extends IncompleteClass{}
hense java does not support multiple inheritance.
or
class IncompleteClass extends ConcreteClaNm{}
But
class ConcreteClaNm implements interface1,interface2....
{
}
or
class IncompleteClass implements interface1,interface2....
{}

public interface InterName extends InterName1,InterName2...
{}

We achive single inheritance and multiple inheritance like this.

Is This Answer Correct ?    0 Yes 4 No

why java does not support multiple inheritance..

Answer / devesh dashora

Basically multiple inheritance is useful only in
polymorphism, so in java it can be done by interfaces, so
that java doesn't need to provide multiple inheritance
using extends keyword.

Is This Answer Correct ?    22 Yes 34 No

why java does not support multiple inheritance..

Answer / ouali international

Multiple inheritance in Java is not allowed directly simply
because Java has another concept of Interfaces that replace
the ambiguity of this problem in other OOP languages such
as C++.

Is This Answer Correct ?    9 Yes 23 No

why java does not support multiple inheritance..

Answer / reshma mittal

java does not support multiple inheritance because in java
we can develop web based application
suppose we r trying 2 download a file that has extended
many classes if 995 of classes get downloaded and even 1%
gives error in downloading then there is no use of
downloading

that's why java avoid such comlexities of interdependency
so it avoid multiple inheritance

Is This Answer Correct ?    2 Yes 16 No

why java does not support multiple inheritance..

Answer / sskur

Java was designed without multiple inheritance.Java
interfaces solves most problems that are commonly solved
using multiple inheritance just simulates inheritance .

Kalaivani , Kishore don't misguide others unless your
absolute with your answers.

Is This Answer Correct ?    40 Yes 72 No

why java does not support multiple inheritance..

Answer / lalatendu

Because in java a class doesn't extend more than one class

Is This Answer Correct ?    22 Yes 96 No

Post New Answer

More Core Java Interview Questions

Can a constructor have different name than a class name in java?

0 Answers  


what is the use of private constructor in core java?

3 Answers   OnMobile, Satyam, Yash Technologies,


How big is a gigabyte?

0 Answers  


how can we use the servlet as standalone apllication?should we need to extend any class?

2 Answers   Logica CMG,


Hi buddy, well i got that there is always a default constructor with abstract class. OK. But why not with interface? Thanks in advance.

2 Answers  






What is ide with example?

0 Answers  


what is the use of Clonable,and serializable interface?

1 Answers  


What is a file pointer?

0 Answers  


what ide u r using and wat version, how wil u build the project etc ?

2 Answers  


public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod

4 Answers   TCS,


How can you say java is object oriented?

0 Answers  


What is multithreading ???? How to stop multithrading in java????

1 Answers   Cognizant,


Categories