读书人

HashMap跟IdentityHashMap的区别

发布时间: 2012-10-09 10:21:45 作者: rapoo

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

读书人网 >编程

热点推荐