日期:2014-05-20 浏览次数:20983 次
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
public class TestMap {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<Map.Entry<String, Integer>, Integer> m5 = new TreeMap<Map.Entry<String, Integer>, Integer>(new Comparator<Map.Entry<String, Integer>>() {
public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
return (o2.getValue() - o1.getValue());
}
});
}
}