title: Is there a way to guarantee an interface extends a class in Java?
body: <p>Suppose I have the following situation:</p>
  
  <pre><code>public abstract class Vehicle {
    public void turnOn() { ... }
  }
  
  public interface Flier {
    public void fly();
  }
  </code></pre>
  
  <p>Is there a way that I can guarantee that any class that implements <code>Flier</code> must also extend <code>Vehicle</code>? I don't want to make <code>Flier</code> an abstract class because I want to be able to mix a few other interfaces in a similar manner.</p>
  
  <p>For instance:</p>
  
  <pre><code>// I also want to guarantee any class that implements Car must also implement Vehicle
  public interface Car {
    public void honk();
  }
  
  // I want the compiler to either give me an error saying
  // MySpecialMachine must extend Vehicle, or implicitly make
  // it a subclass of Vehicle. Either way, I want it to be
  // impossible to implement Car or Flier without also being
  // a subclass of Vehicle.
  public class MySpecialMachine implements Car, Flier {
    public void honk() { ... }
    public void fly() { ... }
  }
  </code></pre>