title: Using and declaring generic List<T>
body: <p>So I'm working in Java and I want to declare a generic List.</p>
  
  <p>So what I'm doing so far is <code>List&lt;T&gt; list = new ArrayList&lt;T&gt;();</code></p>
  
  <p>But now I want to add in an element. How do I do that? What does a generic element look like?</p>
  
  <p>I've tried doing something like List.add("x") to see if I can add a string but that doesn't work. </p>
  
  <p>(The reason I'm not declaring a <code>List&lt;String&gt;</code> is because I have to pass this List into another function that only takes <code>List&lt;T&gt;</code> as an argument. </p>