title: creating an arraylist of linkedlist
body: <p>I want to create a chained hash table. It need to be a list of linkedlists, the istructions say I should do it as follows:</p>
  
  <pre><code>ArrayList&lt;LinkedList&lt;String&gt;&gt; hashTable
  </code></pre>
  
  <p>to initialize the table I use this code:</p>
  
  <pre><code>            public static ArrayList&lt;LinkedList&lt;String&gt;&gt; createNewTable (){
      double tableSize = Math.pow(baseTableSize, initialTableExponent);
      for (int i = 0; i &lt; tableSize; i++){
          LinkedList&lt;String&gt; row = new LinkedList&lt;String&gt;();
          hashTable.add(row);
      }
      return hashTable;
  }
  </code></pre>
  
  <p>BUT, when I run it in the "main" I get this exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NullPointerException</p>
  </blockquote>
  
  <p>what is the problem?
  is there a better way of doing it?</p>
  
  <p>thanks!</p>