Possible Duplicate:
Sort arrays of primitive types in descending order
Java : How to sort an array of floats in reverse order?
How do I reverse an int array in Java?
The following code will sort the array in ascending order :
int a[] = {30,7,9,20};
Arrays.sort(a);
System.out.println(Arrays.toString(a));
I need to sort it in descending order. How do I use Comparator to do this?
Please help.