Hi..
Ques : Hello friend now I an working collection in a .NET. In a collection i am using Hashtable but i am not understaind How does a Hashtable internally maintain the key-value pairs?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Feb 20, 2012, 6:48 AM EST
http://msdn.microsoft.com/en-us/library/system.collections.hashtable.aspx
Contrary to what it says there, the key/value pairs are not actually stored in DictionaryEntry objects but these objects are created when the Hashtable needs to be iterated.
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 20, 2012, 5:55 PM EST
A HashTable collection stores a (Key, Value) pair and uses the Key to hash and obtain the storage location. The Key is immutable and cannot have duplicate entries in the HashTable. This sample uses several instances of a simple Person class to store in a HashTable. The last name is used as the Key.
hope this help.
Sam HobbsRank #107 · 20.5K reputationPosted Feb 20, 2012, 6:16 PM EST