For example:
My first column in the array is at first numerically in order. The Second column is numerically random. I want to place the second column in order, which of course will force the first column out of order. Any ideas how to do this in java. I have searched, but can’t seem to find the vocabulary to properly find it.
The method you can use is one of the Arrays.sort(), where you define your own comparator, which can compare two rows of a two-dimensional array.
The code below allocates an array with two columns and ten rows, with the first column sorted and the second one completely random. Then it sorts it according to the second column.
Example output: