Is there any EASY way to sort an array in descending order like how they have a sort in ascending order in the Arrays class http://www.j2ee.me/javase/6/docs/api/java/util/Arrays.html
?
Or do I have to stop being lazy and do this myself :[
Is there any EASY way to sort an array in descending order like how they have a sort in ascending order in the Arrays class http://www.j2ee.me/javase/6/docs/api/java/util/Arrays.html ? Or do I have to stop being lazy and do this myself :[ |
|||||||||
|
You could use this
|
|||||
|
You can use this:
Collections.reverseOrder() returns a Comparator using the inverse natural order. You can get an inverted version of your own comparator using Collections.reverseOrder(myComparator). |
|||||||||
|