1.

Why is a Dictionary preferred over a Hashtable in C#?

Answer»

Dictionary and Hashtable are Collections classes in C#. Hashtable class is a COLLECTION of key-and-value PAIRS organized based on the hash CODE of the key.

Dictionary is a collection of keys and values. Hashtable is SLOWER than Dictionary. For strongly-typed collections, the Dictionary collection is faster and you prefer them.



Discussion

No Comment Found