首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

HashMap跟IdentityHashMap的区别

2012-10-09 
HashMap和IdentityHashMap的区别in an IdentityHashMap, two keys k1 and k2 are considered equal if and

HashMap和IdentityHashMap的区别
in an IdentityHashMap, two keys k1 and k2 are considered equal if and only if (k1==k2). (In normal Map implementations (like HashMap) two keys k1 and k2 are considered equal if and only if (k1==null ? k2==null : k1.equals(k2)).)

--From Java docs

热点排行