title: Instantiating generic type ArrayList<T>
body: <p>I am new to generics and read in a article "A parameterized type, such as <code>ArrayList&lt;T&gt;</code>, is not instantiable — we cannot create instances of them".</p>
  
  <p>Full quote, from Java in a Nutshell:</p>
  
  <blockquote>
    <p>A parameterized type, such as <code>ArrayList&lt;T&gt;</code>, is not instantiable - we
    cannot create instances of them. This is because <code>&lt;T&gt;</code> is just a type
    parameter - merely a place-holder for a genuine type. It is only when
    we provide a concrete value for the type parameter, (e.g.,
    <code>ArrayList&lt;String&gt;</code>), that the type becomes fully formed and we can
    create objects of that type.</p>
    
    <p>This poses a problem if the type that we want to work with is unknown
    at compile time. Fortunately, the Java type system is able to
    accommodate this concept. It does so by having an explicit concept of
    the unknown type which is represented as <code>&lt;?&gt;</code>.</p>
  </blockquote>
  
  <p>I understand that it should not be instantiable since the concrete (actual) type is not known. If so, why does the below code compiles without an error?</p>
  
  <pre><code>public class SampleTest {
  
      public static &lt;T&gt; List&lt;T&gt; getList(T... elements) {
  
          List&lt;T&gt; lst = new ArrayList&lt;&gt;(); // shouldn't this line return an error? 
  
          return lst;
      }
  }
  </code></pre>
  
  <p>I know there is a gap in my understanding of generics here. Can someone point out what am i missing here?</p>