Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is diamond Problem Faced in Multiple inheritence in java ?  RSS feed

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Any one knows about the diamond problem in java Interface.

Please explain with example.

Regards,
Prabhat
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you go: Diamond problem. Java doesn't support multiple inheritance, so it doesn't have this issue.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
He is not asking about the diamond problem in combination with inheritance but in combination with interfaces. And it does exist:


But I don't have a solution for you
 
Campbell Ritchie
Sheriff
Posts: 53766
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that is a problem; I am pretty sure that code won't compile: no compilation, no problems at runtime
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just don't write ANY code AT ALL. Then you don't need to compile anything and you will have no runtime-errors
 
Campbell Ritchie
Sheriff
Posts: 53766
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Touche. Even Joanne Neal wouldn't have produced a comeback like that
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!