Possible Duplicate:
Sort a two dimensional array based on one column
I have the data:
"Something1" "TRUE"
"Something2" "FALSE"
"Something3" "FALSE"
"Something4" "TRUE"
That I then store in a multidimensional array:
String[][] myData = new String[data.length][2];
Now I want to sort this array so that it is ordered by “TRUE” first, so it becomes:
"Something1" "TRUE"
"Something4" "TRUE"
"Something2" "FALSE"
"Something3" "FALSE"
I’m looking at Arrays.sort(); but not sure how to implemtent this or if this is even the best way.
Sort your array with a custom comparator: