Computing.Net > Forums > Programming > java multiple inheritence..

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

java multiple inheritence..

Reply to Message Icon

Name: srisailamg
Date: May 17, 2004 at 22:34:25 Pacific
OS: windows
CPU/Ram: intel
Comment:

Why java doesn't support multiple inheritence? what advantages it has?

srisailam



Sponsored Link
Ads by Google

Response Number 1
Name: gpp
Date: May 18, 2004 at 05:50:38 Pacific
Reply:

>Why java doesn't support multiple inheritence?

To keep the language simple. They do allow for multiple interface inheritance.

>what advantages it has?

Is that a question or a general statement?


0

Response Number 2
Name: Sanjaya Sugiarto (by Sanjaya)
Date: June 4, 2004 at 12:53:43 Pacific
Reply:

Well, I dont agree with gpp.

Java doesnt support multiple inheritance because it want to run safer, stabler and non error-prune.

Just imagine situation like this:

You have a super class named DigitalRecorder and it has method burn(). Than from it would be 2 classes CDBurner and DVDBurner and each inherit the method burn(). Than from these two classes would be ComboDrive and now the problem is: Which burn() method should it use??

This problem called Deadly Diamond of Death.

With Java you wont get into this scenario.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: java multiple inheritence..

No multiple inheritance, resolve??? www.computing.net/answers/programming/no-multiple-inheritance-resolve/4282.html

The D Language www.computing.net/answers/programming/the-d-language/10865.html

C++ Compiler www.computing.net/answers/programming/c-compiler/11990.html