public static void maptree1(Map map) {
Map<String, User> m = new TreeMap<String, User>(new Comparator<User>() {
@Override
public int compare(User o1, User o2) {
return o1.compareTo(o2);
}
});
代码是这个
![图片说明](https://img-ask.csdn.net/upload/201811/07/1541588854_676951.png)