【发布时间】:2022-12-03 14:38:14
【问题描述】:
public static void main(String[] args) {
Map<Character, Integer> map = new HashMap();
map.put('A',1);
map.put('a',1);
map.put('f',5);
map.put('t',5);
map.put('m',4);
map.put('r',3);
System.out.println(map.keySet());
}
无法理解为什么这里的输出不按顺序,例如: [A,a,f,t,m,r]
相反,它正在打印: [A, a, r, t, f, m]
谁能解释一下?
谢谢 :)
【问题讨论】: