This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

MULTIPLE IMPLEMENTATION INHERITANCE  RSS feed

 
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is being asked several times in this forum,Still I am not able to understand the concept.If somebody can explain it with real object examples(layman explanation)
Why java does not support multiple implementation inheritance? And at the same time C++ does support the multiple implementation inheritance, how does C++ support multiple implementation inheritance? If C++ can support multiple implementation inheritance, why java can�t? I would like to know the reason for not supporting multiple implementation inheritance and where it will create problem for the developers if they use multiple implementation inheritance in java?
If somebody knows about it, please try to explain it with examples and proper reasoning.
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds very much like a homework assignment, but in any event, Java doesn't support multiple inheritance because its inventor, James Gosling thought (rightly so) it made things Too Complicated. Multiple inheritance causes more problems than it solves, including implementation collisions/ambiguities that are very hard to design around. Plus it led to sloppy coding styles in C++.
With interfaces you get most of the benefits of actual multiple inheritance without a lot of the same problems.
Yea, I know, some people think differently but hey, it works for me.
James Gosling
 
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread provides a good description of the drawbacks of multiple inheritance and illustrates those drawbacks using objects. (BTW, Michael Morris gets applause for his fine use of (crypto-) zoology in the referenced thread )
I am pleased to see that the article in the prior post mentioned Objective C. Unlike most people, I come to Java from extensive experience using Objective C. I was wary about coming to Java when I first started for fear that it would prohibit many of the "neat" things we were doing in Objective C. Then I happily discovered that, while syntatically it may look like C++, semantically it takes a lot from the Objective C / Smalltalk world (interfaces, forcing everything to inherit from one base class, Reflection, etc.)
[ May 29, 2003: Message edited by: Joel McNary ]
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!