Differences between Hashtable and Dictionary | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Differences between Hashtable and Dictionary

What ae the difference between Hashtable and Dictionary

14th Dec 2016, 5:03 AM
Akwin Lopez
Akwin Lopez - avatar
1 Answer
0
Dictionary: It returns error if we try to find a key which does not exist. It is faster than a Hashtable because there is no boxing and unboxing. Only public static members are thread safe. Dictionary is a generic type which means we can use it with any data type. Hashtable: It returns null if we try to find a key which does not exist. It is slower than dictionary because it requires boxing and unboxing. All the members in a Hashtable are thread safe, Hashtable is not a generic type,
14th Dec 2016, 5:03 AM
Akwin Lopez
Akwin Lopez - avatar