title: Java Generics WildCard Question: List<? extends A>
body: <p>Let's say I have these classes :  Vehicle, Car and Spaceship:</p>
  
  <pre><code>class Vehicle{
  
      void rideVehicle(Vehicle v){
          System.out.println("I am riding a vehicle!");
      }
  
  }
  
  class Car extends Vehicle{
      void rideVehicle(Vehicle c){
          System.out.println("I am riding a car!");
      }
  }
  
  
  class SpaceShip extends Vehicle{
      void rideVehicle(Vehicle c){
          System.out.println("I am riding a spaceship!");
      }
  
  }
  </code></pre>
  
  <p>and I write this method addCars:</p>
  
  <pre><code>private static void addCars(List&lt;? extends Vehicle&gt; vcls){
          vcls.add(new Car());
          vcls.add(new Car());
          vcls.add(new Car());
  
      }
  </code></pre>
  
  <p>Why do I get a compile time error?? I understand that List is a supertype of List for any X that extends Vehicle. right?</p>
  
  <p>Thanks</p>
  
  <p>Edit: the error I get (compile-time) : The method add(capture#2-of ? extends Vehicle) in the type List is not applicable for the arguments (Car).</p>