• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why can't we extend two super classes in java?  RSS feed

 
Nagaraj Shivaklara
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you please explain why can't we extend two super classes in java? Is this is just the way built in java or any specific reason?

We could have avoided the interface concept by allowing class to extend many super classes right?

May be this is stupid question but i am curious to know why like this.

Thanks
Nagaraj
 
Paul Clapham
Sheriff
Posts: 22832
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether it's stupid or not, it certainly isn't a question about servlets. So let's move it to a better forum...
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read about deadly diamond of death? Its to avoid this that there is no multiple inheritance
 
Nagaraj Shivaklara
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks a lot.. understood completely.
Mohamed Sanaulla wrote:Have you read about deadly diamond of death? Its to avoid this that there is no multiple inheritance
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks mohamed now i also understand.
 
Stephan van Hulst
Saloon Keeper
Posts: 7991
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And even if multiple inheritance was allowed, I'd still be *more* than happy to use interfaces.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!