Use cases for IdentityHashMap

后端 未结 7 707
谎友^
谎友^ 2020-12-12 13:31

Could anyone please tell what are the important use cases of IdentityHashMap?

7条回答
  •  情歌与酒
    2020-12-12 14:24

    One case where you can use IdentityHashMap is if your keys are Class objects. This is about 33% faster than HashMap for gets! It probably uses less memory too.

提交回复
热议问题