1.

How To Sort Arraylist Of Strings In Descending Order?

Answer»

Collections.sort() METHOD will sort the ARRAYLIST of STRING in ascending order. 

To have a descending order EITHER comparator has to be provided or reverseOrder method of the Collections class can be used.

Collections.sort(cityList, Collections.reverseOrder());

Collections.sort() method will sort the ArrayList of String in ascending order. 

To have a descending order either comparator has to be provided or reverseOrder method of the Collections class can be used.

Collections.sort(cityList, Collections.reverseOrder());



Discussion

No Comment Found