I have two arrays:
int[] intArray = new int[]{point1,point2,point3,point4};
String[] strArray = new String[]{worda,wordb,wordc,wordd};
Now, I want to sort intArray in numerical order, such that strArray follows the same order. I'm sure this is a common problem, but I can't get it to work. I made a TreeMap and added the values in from each array. Shouldn't a TreeMap automatically sort by the key, intArray[]? It doesn't appear to work.
TreeMap theMap = new TreeMap();
theMap.put(intArray, strArray);