I have a test tomorrow where we write a code based on what is asked. I need some explanation on how to sort a 2D array in increasing order. I can do this for a 1D array but I'm not sure if the same code will work for the 2D. Can you just explain how to implement this for a 2D array in your own way, I don't want you to think this is for homework, I just need to know how to do this for a test tomorrow. Thanks
for (i = 0; i < a.length - 1; i++) {
for (j = i+1; j < a[0].length; j++) {
if (a[i] < a[j]) {
int temp = a[i];
a[i] = a[j];
a[j] = temp;
System.out.print(temp);
}
}
}