File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes What is diamond Problem Faced in Multiple inheritence in java ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is diamond Problem Faced in Multiple inheritence in java ?" Watch "What is diamond Problem Faced in Multiple inheritence in java ?" New topic
Author

What is diamond Problem Faced in Multiple inheritence in java ?

Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 397
Hi,
Any one knows about the diamond problem in java Interface.

Please explain with example.

Regards,
Prabhat
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
Here you go: Diamond problem. Java doesn't support multiple inheritance, so it doesn't have this issue.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

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


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40436
    
  28
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

Joined: Oct 25, 2008
Posts: 2700

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

Joined: Oct 13, 2005
Posts: 40436
    
  28
Touche. Even Joanne Neal wouldn't have produced a comeback like that
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is diamond Problem Faced in Multiple inheritence in java ?