Showing posts with label Dictionary. Show all posts
Showing posts with label Dictionary. Show all posts

Friday, 20 March 2015

c# hashtable vs dictionary

Hashtable and Dictionary both of them are used to maintain the key, value pair only there is some basic difference that makes us to opt, any of this 2 based on the situations.

Differences  between Hashtable and Dictionary.

1.       Declaration of Hashtable and dictionary;
Dictionary:
Dictionary<int, string> dict = new Dictionary<int, string>();

Hashtable :
Hashtable hst = new Hashtable();