Search
“referencial”
More pages from the web
1–1 of 1-
arraylist.blogspot.com
Arraylist
Arraylist When and Where to use the IdentityHashMap IdentityHashMap allows == for comparison of keys rather than equals() method which is used by HashMap. IdentityhashMap is used in places where referencial integrity should be used for comparing keys. This answers the question of using mutatble objects as keys - usually considered a "not so good" practice. If we do IdentityHashMap ihp = new IdentityHashMap (); ihp.put("a", "somevalue); ihp.put(new String("a"), somevalue
