Re: why is multiple inheritance not implemented in java?
Wildemar Wildenburger wrote:
Lew wrote:
public class AbstractWidget implements Widget, Movable, Hidable,
Detachable, Skinnable, Favorable, GenerallyUseful
{
}
public class MyWidget extends AbstractWidget
{
}
Now 'MyWidget' will "have all sorts of useful features 'out of the
box', merely by subclassing", with the additional guarantee that the
default implementations are Widgetish, and not, for example, Mammalian
('Mammal' being another class that implements 'Skinnable').
I *kind of* see your point, but not really. Does that imply that every
implementation can double as an interface? Because otherwise you would
still have to come up with implementations for all those interfaces. I
wouldn't file that under "out of the box". Sorry for being so naggy, I'd
really like to understand the way things are meant to be done in Java
(need to get some of that Python skin off me. Congrats on that
Widget/Mammal angle, by the way, that was funny.)
It's "out of the box, but you have to build your own box."
And of course you have to come up with implementations - that's what they're
for. One could say that that is what a programmer does - come up with
implementations for the methods they need.
You'd have to build the base classes for your "out-of-the-box"
multiple-inheritance scenario, too. What's the difference?
--
Lew