In simple Hashtable is that which optimizes Searching criteria. That means a person having Surname.. In a group of people a person can easily been identified with his Surname.In the same manner Hash table contains Key,Value pairs which helps for optimizing Lookup's.
Lookup means: A procedure which a value is been searched until it is found.
Items in Hashtable are added with Add() method.
Example in c#::
Hashtable hashtable = new Hashtable();
hashtable[1] = "One";
hashtable[2] = "Two";
hashtable[13] = "Thirteen";
foreach (DictionaryEntry entry in hashtable)
{
Console.WriteLine("{0}, {1}", entry.Key, entry.Value);
}
Thanks,
Prabhu Kiran Bommareddy
Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator