Sort an ArrayList of Strings that are numbers

后端 未结 6 1738
孤街浪徒
孤街浪徒 2021-01-18 02:05

What is the fastest way to sort an ArrayList (in descending/ascending manner) that contains numbers, eg: { \"12\", \"3.5\", \"188\", \"33.03

6条回答
  •  难免孤独
    2021-01-18 02:22

    You can try sortedset interface which enables you the sorted data during the time of entering the data.Better implement your own comparator which will be little beneficial i believe.

提交回复
热议问题