static int[] a = {1, 2, 3, 4};
static int[] b = {5, 6};
static int[] c = {7, 8};
static int[][] d = {a, b, c};
static int[] data = new int[d.length];
public static void main(String[] args) {
recursion(0);
}
public static void recursion(int index) {
for (int i = 0; i < d[index].length; i++) {
data[index] = d[index][i];
if (index == d.length - 1) {
System.out.println(new Gson().toJson(data));
} else {
recursion(index+1);
}
}
}