static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            MyDictionary <int, string> musteriler = new MyDictionary <int, string>();

            musteriler.Add(1, "Alihan");
            musteriler.Add(2, "Ferhan");
            musteriler.Add(3, "İbrahim");

            for (int i = 0; i < musteriler.Count(); i++)
            {
                Console.WriteLine(musteriler.keys[i] + " " + musteriler.values[i]);
            }


            Console.WriteLine("Number of customers :" + musteriler.Count());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            //The operation of the dictionary and list classes is tested in this section.

            MyDictionary <int, string> myDictionary = new MyDictionary <int, string>();

            myDictionary.Add(5, "Ahmet");
            Console.WriteLine(myDictionary.Count());
            myDictionary.Add(6, "Mehmet");
            Console.WriteLine(myDictionary.Count());
            myDictionary.Add(4, "Ayça");
            Console.WriteLine(myDictionary.Count());
            myDictionary.Add(6, "Mehmet");
            Console.WriteLine(myDictionary.Count());
            myDictionary.Add(6, "Mehmet");
            Console.WriteLine(myDictionary.Count());
            Console.WriteLine("-------------------------------------------------");

            MyDictionary <int, string> dictionarySample = new MyDictionary <int, string>();

            dictionarySample.Add(0, "Muhammet");
            dictionarySample.Add(1, "Emin");
            dictionarySample.Add(2, "Aslangil");
            dictionarySample.Add(1, "Muhammet");
            dictionarySample.Add(2, "Muhammet");
            dictionarySample.Add(5, "Muhammet");
            dictionarySample.Add(-1, "Aslangil");

            Console.WriteLine("dictionarysSample's item count: " + dictionarySample.Count());
            Console.WriteLine("-------------------------------------------------");

            MyList <string> names = new MyList <string>();

            names.Add("Muhammet");
            names.Add("Emin");
            names.Add("Aslangil");
            names.Add("C#");
            names.Add("Muhammet");
            names.Add("Githup");

            Console.WriteLine("names's item count: " + names.Count());
        }
Exemple #3
0
        static void Main(string[] args)
        {
            MyList <string> isimler = new MyList <string>();

            isimler.Add("American Express");
            isimler.Add("VISA");
            isimler.Add("MasterCard");
            isimler.Add("TROY");

            Console.WriteLine(isimler.Count() + " elemanlı isimler sınıfı oluşturuldu!");
            Console.WriteLine("---------------------------");


            MyDictionary <string, string> myDictionary = new MyDictionary <string, string>();

            myDictionary.Add("3", "American Express");
            myDictionary.Add("4", "VISA");
            myDictionary.Add("5", "MasterCard");
            myDictionary.Add("9", "TROY");
            Console.WriteLine(myDictionary.Count() + " elemanlı myDictionary sınıfı oluşturuldu!");
            Console.WriteLine("---------------------------");
        }