Interviews1 answer
What is the difference between Hashtable and Dictionary?
1 Answer
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# Declaration
Hashtable numbers = new Hashtable();
Dictionary dictionary = new Dictionary();
Thennarasu NPosted Oct 22, 2016, 1:21 PM EDT
