title: Java wildcards and generics ? super T and ? extends T
body: <p>when dealing with wildcards such as setting/adding a generic item to a certain container is it suggested to use something like this?</p>
  
  <pre><code>void add(List&lt;?  super T&gt; someList,someitem){
      someList.add(someItem);
  }
  </code></pre>
  
  <p>and when retrieving an item it is suggested to use something like this</p>
  
  <pre><code> &lt;T&gt; void f1(List&lt;? extends T&gt; obj, T item) {
       obj.add(item);
  }
  </code></pre>
  
  <p>What is the principle behind this? and when will I know if I should use this ?</p>