TreeMap<Character,Integer> tm = new TreeMap<Character,Integer>(
new Comparator<Map.Entry<Character,Integer>>(){
public int compare(Map.Entry<Character,Integer> me1, Map.Entry<Character,Integer> me2){
int mun = me1.getValue().compareTo(me2.getValue());
if(mun==0)
return me1.getKey().compareTo(me2.getKey());
return mun;
}
});
new TreeMap然后以匿名内部类的形式传了一个比较器进去,编译报错:
找不到符号
符号: 构造函数 TreeMap(<匿名 java.util.Comparator<java.util.Map.Entry<java.lang.Character,java.lang.Integer>>>)
位置: 类 java.util.TreeMap<java.lang.Character,java.lang.Integer>
TreeMap<Character,Integer> tm = new TreeMap<Character,Integer>( |
|