title: Adding object to array of LinkedList java
body: <p>So I'm working with hashing and want to create an array of LinkedList. How do you add the new Object to the LinkedList using the table[index]. This is what I have so far, but when I try to call the LinkedList method add it doesn't work. Is it because everything is set to null beforehand? Do I need to add everything manually?</p>
  
  <pre><code>private void populateLinkedList(LinkedList&lt;String&gt;[] table, ArrayList&lt;String&gt; dictionary){
      for(String s:dictionary){
          String temp=findHash(s);
          System.out.print(temp + ": ");
          int hashKey=hashFunction(temp);
          Anagram obj=new Anagram(s, temp, hashKey);
                      table[hashKey].add(obj);
      }       
  }
  </code></pre>
  
  <p><code>populateLinkedList(hashTable, dictionaryList);</code> This is how I call the function.</p>