10 Kasım 2013 Pazar

ArrayList, Dictionary, List , Hashtable veri tipleri C#

//ArrayListArrayList liste = new ArrayList();
liste.Add("bir");
liste.Add("iki");
liste.Add(false);
foreach (var element in liste)
{
Console.WriteLine(element);
}

//Dictionary
Dictionary<string, int> dict = new Dictionary<string, int>();dict.Add("bir", 1);
dict.Add("iki", 2);
string veri = dict["bir"];
string veri2= dict["iki"];
//List
List<string> liste = new List<string>();
liste.Add("bir");
liste.Add("iki");
foreach (string element in liste)
{
Console.WriteLine(element);
}
List<string> liste = new List<string>();
liste.Add("bir");
liste.Add("iki");
foreach (string element in liste)
{
Console.WriteLine(element);
}
//Hashtable
Hashtable table = new Hashtable();
table["bir"] = 1;
table["iki"] = 2;
Hashtable table = new Hashtable();
table["bir"] = 1;
table["iki"] = 2;

Hiç yorum yok:

Yorum Gönder