The output of the following code sample is:
{1--e=e2, 2--e1=e1}
package com.sid.practice; import java.util.HashMap; import
The Javadocs for HashMap state for the put method:
put
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
Hence, the key is not overwritten, only the value.