title: generics error: not applicable for the arguments
body: <p>Can someone explain to me why the following code does not work?</p>
  
  <pre><code>public class Test {
  
   interface Strategy&lt;T&gt; {
     void execute(T t);
   }
  
   public static class DefaultStrategy&lt;T&gt; implements Strategy&lt;T&gt; {
     @Override
     public void execute(T t) {}
   }
  
   public static class Client {
     private Strategy&lt;?&gt; a;
  
     public void setStrategy(Strategy&lt;?&gt; a) {
       this.a = a;
     }
  
     private void run() {
       a.execute("hello world");
     }
   }
  
   public static void main(String[] args) {
     Client client = new Client();
     client.setStrategy(new DefaultStrategy&lt;String&gt;());
     client.run();
   }
  }
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>The method execute(capture#3-of ?) in the type Test.Strategy&lt;capture#3-of ?&gt; 
  is not applicable for the arguments (String)
  </code></pre>
  
  <p>I've got it to work by altering code as follows:</p>
  
  <pre><code>public class Test {
  
   interface Strategy&lt;T&gt; {
    void execute(T t);
   }
  
   public static class DefaultStrategy&lt;T&gt; implements Strategy&lt;T&gt; {
     @Override
     public void execute(T t) {}
  
   }
  
   public static class Client&lt;T&gt; {
     private Strategy&lt;T&gt; a;
  
     public void setStrategy(Strategy&lt;T&gt; a) {
       this.a = a;
     }
  
     private void run(T t) {
       a.execute(t);
     }
   }
  
   public static void main(String[] args) {
     Client&lt;String&gt; client = new Client&lt;String&gt;();
     client.setStrategy(new DefaultStrategy&lt;String&gt;());
     client.run("hello world");
   }
  }
  </code></pre>
  
  <p>but I want to understand why the original approach did not work.</p>