i have an 2d Array which is [2][10]. It is filled with random numbers. Could someone please help me how to sort it? I dont know why but any found way to sort it with Comparator doesnt work for me. So im trying to do that in a loop. It has to be sorted by the column.
Im trying to play with creating a temporary array and inserting the value into it, but i dont know how to compare values: [0][0] and [0][1]. My try is do 2 for loops and inside it:
for (int i = 0; i < arr4.length; i++) {
for(int j = 0; j < arr4[i].length; j++) {
if(arr4[i][j] > ???????)
temparray = arr4[i][j];
}
}
Help me please...