How do I initialize the values of an ArrayList?
I found this on the internet, but it doesn't work.
ArrayList<Kaart>[] hand = (ArrayList<Kaart>[]) new ArrayList[AANTALSPELERS];
All elements of hand
are null
. I get a nullPointerException
because of that. Kaart is a class I created. AANTALSPELERS is a private static final int.