Differences Between Hashtable and Dictionary
1. Hashtable is threadsafe and while Dictionary is not.
2. Dictionary is types means that the values need not to boxing while Hashtable
values need to be boxed or unboxed because it stored the values and keys as
objects.
3. When you try to get the value of key which does not exists in the collection, the
dictionary throws an exception of 'KeyNotFoundException' while hashtable returns
null value.
4. When using large collection of key value pairs hashtable would be considered more
efficient than dictionary.
5. When we retrieve the record in collection the hashtable does not maintain the order
of entries while dictionary maintains the order of entries by which entries were added.
6. Dictionary relies on chaining whereas Hashtable relies on rehashing.
2. Dictionary is types means that the values need not to boxing while Hashtable
values need to be boxed or unboxed because it stored the values and keys as
objects.
3. When you try to get the value of key which does not exists in the collection, the
dictionary throws an exception of 'KeyNotFoundException' while hashtable returns
null value.
4. When using large collection of key value pairs hashtable would be considered more
efficient than dictionary.
5. When we retrieve the record in collection the hashtable does not maintain the order
of entries while dictionary maintains the order of entries by which entries were added.
6. Dictionary relies on chaining whereas Hashtable relies on rehashing.

Anandu G NathPosted Dec 28, 2023, 7:17 AM
Can you Explain where we are exactly using Hashtable and Dictionary. With Real time Example
Anil GangwarPosted Jun 6, 2017, 12:49 AM
Dictionary:1. It returns error if we try to find a key which does not exist. 2. It is faster than a Hashtable because there is no boxing and unboxing. 3. Only public static members are thread safe. 4. Dictionary is a generic type which means we can use it with any data type. Hashtable: 1. It returns null if we try to find a key which does not exist. 2. It is slower than dictionary because it requires boxing and unboxing. 3. All the members in a Hashtable are thread safe, 4. Hashtable is not a generic type,
Pawan TiwariPosted Apr 20, 2016, 5:17 AM
Nice explain
Aamir PervezPosted Apr 15, 2016, 2:41 AM
Good
Satya RathorePosted Mar 20, 2015, 10:34 AM
Nice one. Like it.
Satya RathorePosted Mar 20, 2015, 10:34 AM
you can get the more details from below links
neeraj aryaPosted Aug 21, 2014, 11:54 AM
he say with large records that is correct
sunil sharmaPosted Aug 5, 2014, 7:43 AM
point 4 is wrong, dictionary is more efficient than hash table
Rv SinghPosted Oct 13, 2012, 11:07 AM
good