title: linked list NullPointerException
body: <p>I am getting <code>NullPointerException</code> and I don't know why.</p>
  
  <pre><code>LinkedList&lt;Character&gt;[][] list = new LinkedList[n][n];
  
  for (int j = 0; j &lt; n; ++j)
  {
      for (int m = 0; m &lt; 1; m++)
      {
                  // Here is the problem
          list[j][m].add("" + (characterArray[j]));
      }
  }
  </code></pre>
  
  <p>I want to add characters from an array to the list. When I run it it says <code>NullPointerException</code>. I don't know how to initialize the list.</p>