What is the equivalent of java hashmap in Csharp
Visual C# Language
The closest one is System.Collections.Hashtable:
If you are using .NET 2.0 you can also try using the generic dictionary System.Collections.Generic.Dictionary<TKey, TValue>:
Java has both HashTable and HashMap. I believe both are same except that HashMap is not synchronized which makes it more performant.
do we have such collection available in CSharp
None of the .NET Framework collections are synchronized by default.
In the case of Hashtable you can get a synchronized wrapper of an existing hashtable by using Hashtable.Synchronized method:
Hashtable syncHashtable = Hashtable.Synchronized(nonSyncHashtable);
or you can use the SyncRoot property to synchronize using a lock statement