TreeMap<String, Object> signMap = new TreeMap<>();
// 入参
signMap.put("tccount", "admin");
signMap.put("account", "admin");
signMap.put("sccount", "admin");
signMap.put("eccount", "admin");
// 输出: {account=admin, eccount=admin, sccount=admin, tccount="admin"}
进入TreeMap类
public TreeMap() {
comparator = null;
}
查看 “comparator” 字段的说明
/**
* The comparator used to maintain order in this tree map, or
* null if it uses the natural ordering of its keys.
*
* @serial
*/
private final Comparator<? super K> comparator;
意思: 不填值为null , 使用默认排序(默认排序为升序 :a, b,c …)