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.
the code is (All is in main method) :
int v = 8;
ArrayList<Integer>[] adj = new ArrayList[11];
adj[0].add(21);
and the error belongs to the last line. searched a lot but nothing ! plz help, stuck for hours now.