From your current code, you want to initialize an array of arrays of ints.
static int[][] Pos = new int[2][];
static {
int[] array1 = { 0, 1 };
int array2 = { 2, 3 };
Pos[0] = array1;
Pos[1] = array2;
}
More info:
In case you want/need real Lists, you may use one of these approaches:
You're looking for a List<Integer[]>:
static List<Integer[]> Pos = new ArrayList<Integer[]>();
static {
Pos.add(new Integer[] { 0, 1 } );
Pos.add(new Integer[] { 2, 3 } );
}
Or a better option: List<List<Integer>>:
static List<List<Integer>> Pos = new ArrayList<List<Integer>>();
static {
List<Integer> list = new ArrayList<Integer>();
list.add(0);
list.add(1);
Pos.add(list);
list = new ArrayList<Integer>();
list.add(2);
list.add(3);
Pos.add(list);
}
[0, 1]isn't valid Java.int[][] a = new int[2][];is valid.