aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes How do we solve diamand problem in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "How do we solve diamand problem in java" Watch "How do we solve diamand problem in java" New topic
Author

How do we solve diamand problem in java

Ashuthosh san
Ranch Hand

Joined: Jan 28, 2009
Posts: 35
Hi All,

How do i solve a diamond problem. Eg. I am giving the example in general . I have a class A, there are two other classes B and C which extends A and there is one more class D which extends both B and C. How do i deisgn this kind of scenario.

Regards
Asha
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

A Java class cannot extend more than one Java classes. For more information, read this.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

There *is* no diamond problem in Java.
Ashuthosh san
Ranch Hand

Joined: Jan 28, 2009
Posts: 35
I have one problem i have two classes A and B , i need both functionality of A and B in C. How do i do it?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Probably composition.
pratik gaurav
Greenhorn

Joined: Oct 04, 2012
Posts: 16

David Newton wrote:Probably composition.

sir can you please explain us Probably Composition
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do we solve diamand problem in java