title: How to properly define an array of linked list in Java ?
body: <p>I tried to define an array of linked list in Java like the following, which compiled fine but it generated 2 warning messages. </p>
  
  <pre><code> LinkedList&lt;Long&gt; [] hashtable = new LinkedList[10];
  
  warning: [rawtypes] found raw type: LinkedList
      LinkedList&lt;Long&gt; [] hashtable = new LinkedList[10];
                                          ^
    missing type arguments for generic class LinkedList&lt;E&gt;
    where E is a type-variable:
      E extends Object declared in class LinkedList
  HashTable.java:13: warning: [unchecked] unchecked conversion
      LinkedList&lt;Long&gt; [] hashtable = new LinkedList[10];
                                      ^
    required: LinkedList&lt;Long&gt;[]
    found:    LinkedList[]
  </code></pre>
  
  <p>So, I tried </p>
  
  <pre><code> LinkedList&lt;Long&gt; [] hashtable = new LinkedList&lt;Long&gt;[10];
  </code></pre>
  
  <p>But this time it would not even compile and generate this error instead. </p>
  
  <pre><code>HashTable.java:13: error: generic array creation
      LinkedList&lt;Long&gt; [] hashtable = new LinkedList&lt;Long&gt;[10];
                                      ^
  1 error
  </code></pre>
  
  <p>So, how should I define my array of linked list properly ? </p>