Pages

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;

No comments:

Post a Comment