hashtable definition with example in C#.Net

Hash table will useful for optimization of look ups. It is old dotnet frame work class, which is slower than the dictionary type collection.

For example:
using System;
using System.Collections;

class Example
    static void Main()
 Hashtable objHash= new Hashtable();
 objHash[7] = "India";
 objHash[8] = "US";
 objHash[9] = "London";

 foreach (DictionaryEntry value in objHash)
     Console.WriteLine("{0}, {1}", value.Key, value.Value);
8, US
7, India
Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar