title: Solving the Java Interface Diamond Issue
body: <p>In the past (Java 7 and before), Java classes and interfaces served different roles: classes for abstracting method implementation; interfaces for abstracting object structure. However, since Java 8, interfaces can now define a method implementation using default methods. This leads to a problem known as the "diamond problem".</p>
  
  <p>An interface <code>A</code> with a method <code>execute()</code> is extended by interfaces <code>B</code> and <code>C</code> containing default implementations of <code>execute()</code>. If a class then implements <code>B</code> and <code>C</code>, there is ambiguity to which default implementation of <code>execute()</code> should be run.</p>
  
  <pre><code>interface A {
      public void execute();
  }
  
  interface B extends A {
      default void execute() { System.out.println("B called"); }
  }
  
  interface C extends A {
      default void execute() { System.out.println("C called"); }
  }
  
  class D implements B, C {
  }
  </code></pre>
  
  <p>Given the class definitions above, when <code>(new D()).execute()</code> is executed, what will be printed (if anything): "<code>B called</code>", or "<code>C called</code>"?</p>