I have a two dimensional array filled with strings in Java. I want to be able to sort the entire array relative to the column I have chosen to sort by.
For Example:
Say I have an Array of data that looks like this.
|John | C | Doe |
|Sally | A | Miller |
|Chris | B | Sanders|
I specify that I want to sort in descending order based on their middle initial and am returned an array that looks like this.
|John | C | Doe |
|Chris | B | Sanders|
|Sally | A | Miller |
Is there a way to designate a Comparator that will do this?