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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 391
Hi,
Any one knows about the diamond problem in java Interface.

Please explain with example.

Regards,
Prabhat
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Here you go: Diamond problem. Java doesn't support multiple inheritance, so it doesn't have this issue.


Ping & DNS - my free Android networking tools app
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: 38472
    
  23
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: 38472
    
  23
Touche. Even Joanne Neal wouldn't have produced a comeback like that
 
 
subject: What is diamond Problem Faced in Multiple inheritence in java ?