My understanding is that Dictionary does not have boxing issues and faster in performance. Are there cases that the usage of Hashtable would be more advisable compared to Dictionary? Thanks
For .Net 2.0, you pretty much always want Dictionary. However, be warned that it's not just a "drop in replacement" for an existing Hashtable. There are some differences in the way they work (mostly how they handle nulls) that mean you do need to check your code first.
Hashtable
is pretty much deprecated. It might be useful for interfacing with legacy code.
Dictionary
is a generic class introduced in .NET 2.0, along with other classes in System.Collections.Generic
namespace. They supersede classes in System.Collections
namespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With