I would like to know how, if possible, to create a n amount of arrays of the same size. Help would be greatly appreciated. For example: I want to create 10 arrays with the same amount of elements without having to create them one by one: int[] a = new int[]
. Hope this is more clear now.
One of my questions in one of the comments was +- "how do I sort the array row for row / column for column". I figured it out - maybe someone may find it useful.
int[] sortarr = new int[5]; //create array to transfer data from row to new array
for (int i=0; i<N; i++){
for (int j=0; j<5; j++){
sortarr[j] = hands[i][j]; //transfer the data from 2D array's row to sortarr
}
Arrays.sort(sortarr); //sort the row's data
for (int x=0; x<5; x++){
hands[i][x] = sortarr[x]; //transfer the data back to 2D array
}
}
Maybe it's pretty obvious, but I hope this will help someone out there.