<span style="font-size:18px;">/**
* 对hashMap 进行排序
*
*/
public static void hashMapSort(HashMap<String,Integer> result,ArrayList<Entry<String,Integer>> aryList){
Collections.sort(aryList, new Comparator<Map.Entry<String, Integer>>() {
public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2)
{
return (o2.getValue() - o1.getValue());
}
});
}</span>
hashMap 排序方法
最新推荐文章于 2023-10-05 19:50:17 发布