Loading
Create a Dictionary object and populate it and enumerate it to display key value pairs.
For example, to create a Dictionary object that has integer as key and string as value, we can create dictionary object in the following way:
Dictionary
dictNames.Add(1,”Raj”);
dictNames.Add(3,”Ravi”);
dictNames.Add(5,”Kevin”);
In order to retrieve above value enumerate it i.e use foreach loop and use KeyValuePair object as the elements are retrieved as KeyValuePair objects
foreach(KeyValuePair
Console.WriteLine(kvpName.Key+” “+kvpName.Value);