Here’s a simple difference between Hashtable and Dictionary in .NET
| Dictionary | Hashtable |
| It is generic in nature | It is non generic in nature |
| It is defined in the namespace System.Collections.Generic | It is defined in the namespace System.Collections |
| When a request is made to the dictionary and if the key does not exists , you get an exception | When a request is made to the Hashtable and if the key does not exist , null is returned. |
| Doesn’t require boxing and unboxing | Requires boxing and unboxing |
Leave a Reply