Given a list of int[] [{7, 0}, {7, 1}, {6, 1}, {5, 0}, {5, 2}, {4, 4}] I need to convert it into 2D Array {{7, 0}, {7, 1}, {6, 1}, {5, 0}, {5, 2}, {4, 4}} using Java 8.
Before Java 8 we could use the following logic: temp is List<int[]> which contains above list of elements. First res[][] is created of the same size as a List of elements in temp.
int[][] res = new int[temp.size()][2];
for (int i = 0; i < temp.size(); i++) {
res[i][0] = temp.get(i)[0];
res[i][1] = temp.get(i)[1];
}