Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

why java wont support multiple inheritance

  Asked By: Dale    Date: Oct 10    Category: Java    Views: 847
  

1.why java wont support multiple inheritance
2.write a java program without using class

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Chung Tran     Answered On: Oct 10

multiple  inheritance comes with management problems.
so like pointers, multiple inheritance  is not prefered to represent with java.

- go an get an java  assembler and write  your java program  with java assembly
language.

 
Answer #2    Answered By: Salvador Alexander     Answered On: Oct 10

1. To avoid problems such as diamond inheritance. And the interface model is
flexible enough to suit most needs.
2. As soon as you write  a SmallTalk program  that doesn't have a class. If you
don't like classes, there's a multitude of other languages you can use instead.

 
Answer #3    Answered By: Andrew Bryant     Answered On: Oct 10

> 1.why java  wont support  multiple inheritance

Because multiple  inheritance is a inheritantly dangerous approach :)

If both Objects share the same methods which ones do you inherit? The
simple truth of the matter is that with the exception of C/++ ninja
activities there isn't much of a need for it over multiple interfaces.

> 2.write a java program  without using class

I don't know exactly what you are asking here ... If you are saying how
can you write  a java program that doesn't end up as a .class file, the
easy answer is that you can't. The more complex answer is there are
ways, but most of them are horrible and broken and the ones that are not
are often cheap and tacky.

 
Answer #4    Answered By: Becky Baker     Answered On: Oct 10

1) java  doesnot support  multiple inhertiance directly but it supports indirectly
by the concepts called "interface". basically in c++ which supports multiple
inheritance and a class  can inherit from many superclass. but by doing so there
was many problem arised such as which is the base class for an given class. So
to avoid these kind of problems java didnot support multiple  inheritance
directly.
2) the class is the basic of java. So as for as i knew without a class u cannot
write a java program. ur question is like driving a car without wheels.

 
Didn't find what you were looking for? Find more on why java wont support multiple inheritance Or get search suggestion and latest updates.




Tagged: