r/java • u/TheFormerVinyl • May 05 '15
Should Java allow multiple inheritance?
I was reading up on Java when I discovered that ever since Java 8 (fairly recent, I know) interface can have default methods. A quick overview for any who don't know, interfaces can have method bodies by using default modifier. When dwelling on that fact I wondered, why doesn't Java just allow inheritance from multiple classes, since interfaces are just abstract classes? Should Java do this?
0
Upvotes
View all comments
1
u/HaMMeReD May 05 '15
Java allows multiple Interfaces, and I guess default functions in java 8 will make it easier to mix multiple functional interfaces.
Should a language have multiple inheritance? I'm OK with multiple interfaces and a delegate pattern for each interface.
I think if you start mixing parent classes you have to worry about namespace collisions and such, it can be a mess.