HashMap is a collection to store (key,value) pairs and According to the documentation of HashMap the keys are always unique . If you add a key which already exists(collision) in the hashmap, the old value will be replaced.
HashMap is a collection to store (key,value) pairs and According to the documentation of HashMap the keys are always unique . If you add a key which already exists(collision) in the hashmap, the old value will be replaced.