Is there a way to use the first function in the second one to create a double array with random numbers?
public static int[] build1(int size) {
int[] arr = new int[size];
for (int i=0 ; i < arr.length ; i++)
arr[i] = (int)(Math.random() * 127);
return arr;
}
public static int[][] build2(int row, int col) {
int[][] arr2 = new int[row][col];
for (int i = 0; i < arr2.length; i++) {
for (int j = 0; j < arr2[i].length; j++) {
arr2[i][j] = (int)(Math.random() * 127);
}
}
return arr2;
}