title: How to use polymorphism with inheritance and interface at the same time in Java?
body: <p>Suppose I have a class that extends another class and implements one or more interfaces. How can I specify a type that requires such condition? </p>
  
  <p>For example: </p>
  
  <pre><code>class Eagle extends Animal implements Fly {
  }
  
  class Falcon extends Animal implements Fly {
  }
  
  
  public static void main (){
      ??? anAnimalWhoCanFly; 
  }
  </code></pre>
  
  <p>Update: I removed the list. Just suppose I want to have an object that is an object of a class that extends Animal and implements Fly. </p>
  
  <p>Thanks</p>