what is dictionary in c#?

Posted by Venky.Net under C# on 4/28/2012 | Points: 10 | Views : 7678 | Status : [Member] | Replies : 2
hi
what is dictionary and why do use this keyword with example?




Responses

Posted by: Gow.Net on: 4/28/2012 [Member] Starter | Points: 25

Up
0
Down
dictionary is a collection of key value and text value
example
 Dictionary<int, string> obja = new Dictionary<int, string>();

obja.Add(1, "DotNet");
obja.Add(2, "Java");
obja.Add(3, "Php");
foreach(int k in obja.Keys)
{
Console.WriteLine(k);
}
foreach (string kk in obja.Values)
{
Console.WriteLine(kk);
}





gowthaman8870226416

Venky.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Veerac85 on: 4/30/2012 [Member] Starter | Points: 25

Up
0
Down
refer to this link. It explains DIctionary object in DOTNET with various examples and scenarios.
http://technico.qnownow.com/2012/04/19/dictionary-in-c/

Venky.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response