I know advantages and disadvantages of Hashtable and Dictionary.
I want to know when Hash-table is preferred over Dictionary ?
I know advantages and disadvantages of Hashtable and Dictionary.
I want to know when Hash-table is preferred over Dictionary ?
HashTable
is not a Generic Collection, so you can save anytype (object) types into Hashtable
and its type is not known at compile time.
Dictionary
is a Generic collection so you need to specify the type before saving elements into it, so it is type safe
.
I want to know when Hash-table is preferred over Dictionary ?
i don't think this is true because Dictionary
is Typesafe
and also faster because of no burden of boxing and unboxing
of the elements as its elements type is known at compile time.
so you should consider using Dictionary
over Hash-Table