I have a question about sorting.
int[][] array = {{4,2},{1,7},{4,5},{1,2},{1,1},{4,1}};
After sorting this array, it will become like following.
int[][] array = {{1,1},{1,2},{1,7},{4,1},{4,2},{4,5}};
I fell confused about that, if I perform a sort on rows at first and perform a sort on columns at second, how could I change two of the value in the same time when I sort rows and columns.
see this example…
Since you say 2-D array, I assume “date of format …” means a String. Here’s code for sorting a 2-D array of String[][]:
import java.util.Arrays;
import java.util.Comparator;
}