title: Why can't I use ArrayList<String> as a parameter for a generic ArrayList<E> method?
body: <p>I am learning about generics so I made a simple java program so I can learn how they exactly work. But now I am stuck with this program because I can't see why it won't work.</p>
  
  <pre><code>public static void main(String[] args)
      {
          ArrayList&lt;String&gt; strings = new ArrayList&lt;&gt;();
          strings.add("A");
          strings.add("B");
  
          printList(strings);
      }
  
      public static &lt;E extends List&lt;E&gt;&gt; void printList(ArrayList&lt;E&gt; l)
      {
          for (E obj : l)
          {
              System.out.println(obj.toString());
          }
      }
  </code></pre>