-
Contributing Member
Get Method in Hashmap
Can any one of you please explain me as how get() method works internally in HashMap class?Does it internally call equals() method to compare the key which we pass as a parameter in get()?
Since it is said that Strings override equals(), they can be used as a key in hashMap, I just wanted to know if get() internally uses equals() to compare the keys to retreive the value.
-----------------
suresh
-
Junior Member
Re: Get Method in Hashmap
it actually uses both hashCode and equals for find the keys.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules