1
Reply

What is the difference between Hashtable and Dictionary?

Thennarasu N

Thennarasu N

Oct 22, 2016
517
0

    Hashtable and Dictionary are collection of data structures to hold data as key-value pairs. Dictionary is generic type, hash table is not a generic type. The Hashtable is a weakly typed data structure, so you can add keys and values of any Object Type to the Hashtable. The Dictionary class is a strongly types < T Key, T Value > and you must specify the data types for both the key and value.C# DeclarationHashtable numbers = new Hashtable(); Dictionary dictionary = new Dictionary();

    Thennarasu N
    October 22, 2016
    0