Java Array Sort descending?
You could use this to sort all kind of Objects sort(T[] a, Comparator<? super T> c) Arrays.sort(a, Collections.reverseOrder()); Arrays.sort() cannot be used directly to sort primitive arrays in descending order. If you try to call the Arrays.sort() method by passing reverse Comparator defined by Collections.reverseOrder() , it will throw the error no suitable method found for sort(int[],comparator) That will work … Read more