More often than not, they involve mutable object state.
而它们时常也会涉及易变的对象状态。
Clearly, this approach is a pain but the solution is easy: Never use a mutable object type as a key in a HashMap.
很显然,这种方法很糟糕,但是解决方法也很简单:永远不要将可变对象类型用作hashmap中的键。
This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes.
当默认值是一个可变对象,诸如链表、字典或大部分类实例时,会产生一些差异。
应用推荐