I have read somewhere that HashMap uses chaining to resolve collisions. But if that is the case. how can i access all the elements with same key value.
For example :
I don't think HashTable allows duplicate keys. You should read this What happens when a duplicate key is put into a HashMap?