Array, Arraylist, Hashtable, DataDicitonary in C#
Difference between Hash table and Data Dictionary in C# HashTable & Dictionary,Dictionary is generic whereas Hastable is not Generic. · We can add any type of object to HashTable ,but while reteriving we need to Cast it to the required Type.So it is not type safe.But to dictionary,while declaring itself we can specify the type of Key & Value ,so no need to cast while retreiving. HashTable Program: Hashtable ht = new Hashtable(); ht.Add(1,"One"); ht.Add(2,"Two"); ht.Add(3,"Three"); foreach (DictionaryEntry de in ht) { int Key = (int)de.Key; //Casting string value = de.Value.ToString(); //Casting Console.WriteLine( Key + " " + value); } Dictionary Example class DictionaryProgram { static void Main(string[] args) { Dictionary<int,string> dt = new Dictionary<int,string>(); dt.Add(1,"One"); dt.Add (2,"Two"); dt.Add (3,"Three"); foreach (KeyValuePair...