A Hashtable internally contains buckets in which it stores the key/value pairs. The Hashtable uses the key's hashcode to determine to which bucket the key/value pair should map. When you pass a key/value to the Hashtable, it queries the key's hashcode. The Hashtable uses that code to determine the bucket in which to place the key/value. Hashcodes, however, represent only half the picture. The hashcode only tells the Hashtable into which bucket to drop the key/value. Sometimes, however, multiple objects may map to the same bucket, an event known as a collision. In case of collision it looks for the implementation of key's equals method. If two keys are 'unequal' by implementation of equals method it will store the two key/value pair at the same location. Here in your example as you are using String as keys(which are immutable), the value gets replaced as the two keys are equal.