Working with Dictionaries.

Rajesh_Kumar
Posted by Rajesh_Kumar under ASP.NET category on | Points: 40 | Views : 1689
Working of dictionary is same as hashtable.

Dictionary<int,string> dict_names = new Dictionary<int,string>();
dict_names.Add("name","rajesh");
dict_names.Add("surname","sathua");

int value1 = dict_names["name"]; //output will be rajesh
int value2 = dict_names["surname"]; //output will be sathua

Comments or Responses

Login to post response