I have java program like this
public class Distribution {
private LinkedList<Integer > group[];
public Distribution() {
group[0] = new LinkedList<>();
group[0].add(1);
group[0].add(2);
group[0].add(3);
group[1] = new LinkedList<>();
group[1].add(4);
group[1].add(5);
group[1].add(6);
}
public static void main(String args[])
{
Distribution distribution = new Distribution();
}
}
but the compiler says Exception in thread "main" java.lang.NullPointerException.