Wednesday, August 10, 2011

Add duplicate key to a hash table

There cannot be duplicate keys in a hash table. So, adding a duplicate key to the collection using the Add method will give you an exception.

But, you can override an exsisting key with the same key name and a different value as given below:
hashTable[duplicateKey] = newValue;

1 comment:

  1. Thanks for such a nice and updated information. I got some interesting tips from this post.
    Sony Laptops