Friday, June 18, 2004

HashMap

Do anyone thinks , if HashMap.containsKey() returns false, means , the key is NOT mapped in the map? Wrong !!!!!! , Suppose, the state of the Key object changes so that hashcode() now returns different value, after you put your key-value to the map. Now map.containsKey, or map.get will not necessarily return the key-value.

No comments: