I need to sort a String[] with integer values in descending order. I am using String[] since the content of the array can either be a string or an integer.
To sort in descending order,
Arrays.sort(rows, Collections.reverseOrder());
where rows contain "14","0","3";
Sorting works fine if string[] contain words.
I read that Collections.reverseOrder() doesn't work with primitive types, but will this fall under that category since am using String[] and not int[]?
If so, do we have a sorting mechanism other than using a for loop?
StringandIntegerinstances (shouldn't be possible with aString[]), or that it contains strings of integers, e.g."14","0","3"?