• Forum
  • Lounge
  • The /real/ reason there is no MI in Java

 
The /real/ reason there is no MI in Java

Aug 5, 2014 at 3:09am
This answer is wrong:
http://stackoverflow.com/a/2515502/1959975
A deriving class can simply be required to override methods which are overridden by more than one parent class, as it is with interface default methods in java 8.

The real reason has to do with the fact that if two parent classes extend the same superclass, they can call the constructor in different ways. C++ has a solution to this which breaks Java's philosophy.

What I want to know is: Why is that SO answer the most commonly given answer?
Last edited on Aug 5, 2014 at 3:10am
Aug 5, 2014 at 4:01am
He's defining an answer as to why it would be bad even if it were possible, not as a restriction of Java.
Either way, MI doesn't tend to be a good idea. It's a confusing and broken concept in any complicated situation.
Aug 5, 2014 at 11:38am
1
2
public class MyGodClass extends AppDomainObject, HttpServlet, MouseAdapter, 
             AbstractTableModel, AbstractListModel, AbstractList, AbstractMap

It takes 7 days to compile - on the 7th, the compiler rests.
Topic archived. No new replies allowed.