I have List list1 in direct order. List<String> list = Ordering.natural().sortedCopy(asu2);
How to change order. And I don't know how to rewrite methods from extends class, please write with examples or speak clearly.
sort() method sorts the elements of a list in ascending or descending order using the default < comparisons operator between items. Use the key parameter to pass the function name to be used for comparison instead of the default < operator. Set the reverse parameter to True, to get the list in descending order.
Use this:
Collections.reverse(list);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With