使用比较器对成对整数 ArrayList 进行排序时出错

问题描述

我在对成对整数 ArrayList 进行排序时出错,即在以下代码中找不到符号比较器:

Collections.sort(possibleHeights,new Comparater<Pair>(){
    public int compare(Pair p1,Pair p2)
    {
        return p1.getValue()-p2.getValue();
    }
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)