title: Can the Diamond Problem be really solved?
body: <p>A typical problem in OO programming is the diamond problem. I have parent class A with two sub-classes B and C. A has an abstract method, B and C implement it. Now I have a sub-class D, that inherits of B <strong>and</strong> C. The diamond problem is now, what implementation shall D use, the one of B or the one of C?</p>
  
  <p>People claim Java knows no diamond problem. I can only have multiple inheritance with interfaces and since they have no implementation, I have no diamond problem. Is this really true? I don't think so. <strong>See below:</strong></p>
  
  <p>[removed vehicle example]</p>
  
  <p>Is a diamond problem always the cause of bad class design and something neither programmer nor compiler needs to solve, because it shouldn't exist in the first place?</p>
  
  <hr>
  
  <p>Update: Maybe my example was poorly chosen.</p>
  
  <p>See this image</p>
  
  <p><a href="https://i.stack.imgur.com/JM4Vv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JM4Vv.png" alt="Diamond Problem"></a><br>
  <sub>(source: <a href="http://cartan.cas.suffolk.edu/oopdocbook/opensource/src/multinheritance/PersonStudentTeacher.png" rel="nofollow noreferrer">suffolk.edu</a>)</sub>  </p>
  
  <p>Of course you can make Person virtual in C++ and thus you will only have one instance of person in memory, but the real problem persists IMHO. How would you implement getDepartment() for GradTeachingFellow? Consider, he might be student in one department and teach in another one. So you can either return one department or the other one; there is no perfect solution to the problem and the fact that no implementation might be inherited (e.g. Student and Teacher could both be interfaces) doesn't seem to solve the problem to me.</p>