I've got an Array in an ArrayList, and I want to access each element in the Array individually to use them. My code doesn't work:
ArrayList<int[]> freeSpot = new ArrayList<int[]>();
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
freeSpot.add(new int[]{x, y});
}
}
System.out.println(freeSpot.get(int[0]));
Hope somebody can help! Thanks.
freeSpot.get(0)?System.out.println(Arrays.toString(freeSpot.get(0)));System.out.println(freeSpot.get(0)[0]);