File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is diamond Problem Faced in Multiple inheritence in java ?

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • 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
Pie
Posts: 47229
52
  • 0
  • 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
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • 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
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Touche. Even Joanne Neal wouldn't have produced a comeback like that
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic