Why Array of ArrayLists Does't work in Java? : <p>I'm using an Array of ArrayLists of Integer in Java but it can't run. Every time I get the message
"Note: Goal.java uses unchecked or unsafe operations." and
"Note: Recompile with -Xlint:unchecked for details." after compile and when I want to run it message "Exception in thread "main" java.lang.NullPointerException" appears.</p>

<p>the code is (All is in main method) : </p>

<pre><code>int v = 8;
ArrayList&lt;Integer&gt;[] adj = new ArrayList[11];
adj[0].add(21);
</code></pre>

<p>and the error belongs to the last line.
searched a lot but nothing ! plz help, stuck for hours now.</p>
