Why not allow an external interface to provide hashCode/equals for a HashMap?

前端 未结 9 1853
闹比i
闹比i 2020-12-17 15:28

With a TreeMap it\'s trivial to provide a custom Comparator, thus overriding the semantics provided by Comparable objects added to the

9条回答
  •  我在风中等你
    2020-12-17 16:00

    good question, ask josh bloch. i submitted that concept as an RFE in java 7, but it was dropped, i believe the reason was something performance related. i agree, though, should have been done.

提交回复
热议问题