I have a very problematic problem! I have an array list that looks like this:
ArrayList<String[]> teamsToOrder = new ArrayList<String[]>();
In each string array that is added to the ArrayList looks like this:
String[] arrayExample = {teamNumber,score};
String[] array1 = {"340","100"};
String[] array2 = {"7680","70"};
String[] array3 = {"770","110"};
...........
What I want to be able to do is organize the arrays by score (best score to worst) like so:
String[] array3 = {"770","110"};
String[] array1 = {"340","100"};
String[] array2 = {"7680","70"};
...........
How do I organize them and store them in the ArrayList? I am sorry to mention this, but my objective requires me to organize them in ArrayList form. I can't (i'm not allowed to) create a separate class for the data....
Comparatorand sort theArrayList.