tags:

views:

9713

answers:

2

Coming from a Java world into a C# one is there a HashMap equivalent? If not what would you recommend?

+13  A: 

Dictionary is probably the closest. System.Collections.Generic.Dictionary implements the System.Collections.Generic.IDictionary interface (which is similar to Java's Map interface).

R. Bemrose
+1  A: 

Hashtable

Ray
`Dictionary<TKey, TValue>` is preferable, because of compile time type checking and because it doesn't require boxing of value types.
Thorarin