Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


why java does not support multiple inheritance

Answers were Sorted based on User's Feedback



why java does not support multiple inheritance..

Answer / srividhya.y

java does not support multiple inheritance because of ambiguity 0r confusion problem.but multiple inheritance can be achieved through the concept called interfaces.
A class can implement one or more interfaces.
class A extends B extends C
{
//Not possible
}
class A extends B implements C
{
// Possible
}
from interface to class we are inheriting use the keyword
implements.

Is This Answer Correct ?    3 Yes 2 No

why java does not support multiple inheritance..

Answer / umesh bhargava

Java follows single-inhertitance model that is a subclass
can only aquire the properties from a single super class.
The reason is some conflicting issues with multiple classes.

But java do support multiple interface inheritance that is
a sub class can implement more than one interfaces. It can
alternatively used in place of multiple inheritance...but
remember it is multiple interface inheritance.

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / settipalli rajesh

It is because of two reasons?

1.the derived class should contain the properties or functions with the same priority

2.multiple inheritance causes the object of "Object class would be created more than once...

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / k.mahesh

Java does not support multiple inheritance but this problem is solved through interfaces. Interfaces helps Java to achieve several advantages of multiple inheritances without the associated problems\. We can prevent some variables and methods from being accessed by a subclass by declaring them as private.
Always interface gives a template from which we can develop new classes. Interface gives the design part and implementation of the design we must do. Interface tells what to do, but not now how to do. Java supports multiple inheritance through interfaces so that we can take features of tow interfaces into our implementation file.

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / dinesha kumar bhoi

java does not support multiple inheritance

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / akhila

java does not support the multiple inheritance directly,but
it supports multiple inheritance throw interfaces,why means
in JVM get som abigious problem and will get confused as
which method it wil take.it creates complexity.so it does
not supports multiple inheritance directly.

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / dhairya

JAVA DOES NOT SUPPORT MUPLITE INHERTINCE

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / suchithra

To avoid ambiguity problems

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / mythili pulluru

Java does not support a multiple inheritance because of following reason. for example class A
{
}
class B ExtendsA
{
//variables and methods
}
class c ExtendsA
{
//variables and methods
}
class B ExtendsA
{
//variables and methods
}
class D Extends B,C
{
//variables and methods
}
to compile this program it will give a compile time error because of class D felt in a confusion between B,C which class member to be a inherited(two class having same members) .to avoid this confusion java does not support multiple inheritance.

Is This Answer Correct ?    1 Yes 0 No

why java does not support multiple inheritance..

Answer / dewanshu

Java support method overriding means both superclass and
subclass can have the same method name and number of
arguments.If java support multiple inheritance, ambiguity
problem will arise if two or more superclass have the same
method name, and the super keyword will not be able to
decide which superclass to call.
TO remove such ambiguity problem java doen not support
multiple inheritance through extend but it support it
through interface.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More Core Java Interview Questions

What is the difference between @before and @beforeclass annotation?

0 Answers  


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

0 Answers  


What is an arraylist in java?

0 Answers  


what is the difference between applet and swing and gui application in java . What we do with the collections set and list interface

2 Answers   CTS, Phoenix Technologies,


What is the final access modifier in java?

0 Answers  


Explain the inheritance?

0 Answers  


Adapter classes?

3 Answers  


How do you sort objects in java?

0 Answers  


What are the difference between string, string builder, and string buffer in java?

0 Answers  


What methodology can be utilized to link to a database?

0 Answers  


What is 16 bits called?

0 Answers  


Can we declare the main method of our class as private?

0 Answers  


Categories