Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            {
                Dictionary <string, int> letterNumber1 = new Dictionary <string, int>
                {
                    { "a", 1 },
                    { "b", 2 }
                };
                Console.WriteLine(letterNumber1["a"]);
                Console.WriteLine(letterNumber1["b"]);
                foreach (var show in letterNumber1)
                {
                    Console.WriteLine(show);
                }
                Console.WriteLine("Part of no Add");
                letterNumber1.Add("c", 3);
                foreach (var show2 in letterNumber1)
                {
                    Console.WriteLine(show2);
                }

                Console.WriteLine("C# own dictionary part till here");
                Console.WriteLine("********************************");
                Console.WriteLine("My own dictionary part starts from here");
                MyDictionary <string, int> letterNumber2 = new MyDictionary <string, int>();
                letterNumber2.Add("a", 1);
                letterNumber2.Add("b", 2);
                letterNumber2.Add("c", 3);
                letterNumber2.Add("d", 4);
                letterNumber2.List();
                Console.WriteLine("own dictionary part ends here");
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            MyDictionary <int, string> myDictionary = new MyDictionary <int, string>();

            myDictionary.Add(1, "A");
            myDictionary.Add(2, "B");
            myDictionary.Add(3, "C");
            myDictionary.Add(4, "D");
            myDictionary.Add(5, "E");
            myDictionary.Add(6, "F");
            myDictionary.Add(7, "G");
            myDictionary.Add(8, "H");
            myDictionary.Add(9, "I");
            myDictionary.Add(10, "J");

            myDictionary.List();                         //ikisinin bir arada listelenmesi

            foreach (var item in myDictionary.Keys)      // Sadece keylerin listelenmesi
            {
                Console.WriteLine(item);
            }

            foreach (var item in myDictionary.Values)    // sadece değerlerin listelenmesi
            {
                Console.WriteLine(item);
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            MyDictionary <int, string> sehirler = new MyDictionary <int, string>();

            sehirler.Add(61, "Trabzon");
            sehirler.Add(69, "Bayburt");
            sehirler.Add(55, "Samsun");
            sehirler.List();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            MyDictionary<string, int> student = new MyDictionary<string , int>();
            student.Add("Mehmet Uslu" ,154);
            student.Add("Ahmet Çalışkan",452);
            student.Add("Hakan Ünsal" ,753);

            student.List();

            student.Add("Arda Kurt", 545);
            student.List();

            


            


        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            MyDictionary <string, string> customerInformation = new MyDictionary <string, string>();

            customerInformation.Add("names", "Merve");
            customerInformation.Add("surnames", "KÜÇÜKDOĞRU");
            customerInformation.Add("job", "Computer Engineer");

            customerInformation.List();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            MyDictionary <string, int> myDictionary = new MyDictionary <string, int>();

            myDictionary.Add("Van", 65);
            myDictionary.Add("Haktan", 1);
            myDictionary.Add("Okan", 2);
            myDictionary.Add("Yaren", 3);
            myDictionary.Add("Mustafa", 4);
            myDictionary.List();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            MyDictionary <int, string> dictionary = new MyDictionary <int, string>();

            dictionary.Add(100, "armut");
            dictionary.Add(150, "elma");
            dictionary.Add(200, "kivi");
            dictionary.Add(450, "muz");
            dictionary.Add(160, "mandalina");
            dictionary.List();
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            MyDictionary <string, int> myDictionary = new MyDictionary <string, int>();

            myDictionary.Add("Bilge", 1);
            myDictionary.Add("Selver", 2);
            myDictionary.Add("Murat", 3);
            myDictionary.Add("Nil", 4);
            myDictionary.Add("Claudia", 5);
            myDictionary.List();
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            MyDictionary <string, int> myDictionary = new MyDictionary <string, int>();

            // Console.WriteLine(myDictionary.Count);
            myDictionary.Add("Oğuz", 1);
            myDictionary.Add("Busra", 2);
            myDictionary.Add("Fatma", 3);
            myDictionary.Add("Yavuz", 4);

            //Console.WriteLine(myDictionary);

            myDictionary.List();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            MyDictionary <int, string> _arrays = new MyDictionary <int, string>();

            _arrays.Add(1, "Laptop");
            _arrays.Add(2, "Telefon");
            _arrays.Add(3, "Yazıcı");
            _arrays.Add(4, "Kamera");

            Console.WriteLine("Count :{0} ", _arrays.Count);
            _arrays.List();

            Console.ReadLine();
        }