title: How to use interfaces properly in OOP languages
body: <p>I had this question for a long time but all the people who answered me didn't give me a proper answer. I think that the interfaces are used in OOP languages for polymorphism and in a situation like below I don't understand how to handle it,
  [in java]</p>
  
  <p>lets take following interface and two classes,</p>
  
  <pre><code>public interface Vehicle{
      public int noOfWheels();
      public String movingMethod();
  }
  
  public class Car implements Vehicle{
      public int noOfWheels(){
              return 4;
      }
  
      public String movingMethod(){
          return "Drive";
      }
  }
  
  public class Flight implements Vehicle{
  
      public int noOfWheels(){
          return 5;
      }
  
      public String movingMethod(){
          return "Fly";
      }
  
      //a behaviour only applicable to a flight
      public int noOfWings(){
          return 5;
      }
  }
  
  
  =======================================
  simulation
  
      Vehicle v1 = new Car();
      System.out.println(v1.noOfWheels());
      System.out.println(v1.movingMethod);
  
      Vehicle v2 = new Flight();
      System.out.println(v2.noOfWheels());
      System.out.println(v2.movingMethod);
      System.out.println(v2.noOfWings());//this is not working as Vehicle interface doesn't have this method.
  </code></pre>
  
  <p>So, how can we achive the solution for a this kind of problem. I know that we can create another interface for flight types but
  I took this example to express my problem.</p>