Ejemplo n.º 1
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("---------------------------");
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            MyDictionary <string, int> isimler = new MyDictionary <string, int>();

            isimler.Add("Engin", 35);

            Console.WriteLine(isimler.Length);

            isimler.Add("Kerem", 27);

            Console.WriteLine(isimler.Length);

            foreach (var item in isimler.Items)
            {
                Console.WriteLine(item);
            }

            foreach (var id in isimler.Ids)
            {
                Console.WriteLine(id);
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //MyList<string> isimler = new MyList<string>();
            //isimler.Add("Engin");
            //isimler.Add("Mehmet");

            //Console.WriteLine(isimler.Count);

            //isimler.Add("Recep");
            //isimler.Add("Anıl");

            //Console.WriteLine(isimler.Count);

            //foreach (var isim in isimler.Items())
            //{
            //    Console.WriteLine(isim);
            //}

            Dictionary <int, string> isimler = new Dictionary <int, string>();

            isimler.Add(1, "semih");
            Console.WriteLine(isimler.Count);

            foreach (var item in isimler)
            {
                Console.WriteLine(item.Key + " " + item.Value);
            }

            Console.WriteLine("---------------------------------------------");

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

            Console.WriteLine(name.Count);
            name.Add(1, "Semih");
            Console.WriteLine(name.Count);
            name.Add(2, "Mahmut");
            Console.WriteLine(name.Count);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            MyList <string> isimler = new MyList <string>();

            isimler.Add("Fatih");

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

            ogrenciler.Add(1, "Yusuf Emir");
            ogrenciler.Add(2, "Zeynep Sıla");
            ogrenciler.Add(3, "Fethi");
            Console.WriteLine(ogrenciler.Count);

            for (int i = 0; i < ogrenciler.Count; i++)
            {
                Console.WriteLine(ogrenciler.Key(i) + " : " + ogrenciler.Value(i));
            }
            ogrenciler.Add(3, "Fatih");
            for (int i = 0; i < ogrenciler.Count; i++)
            {
                Console.WriteLine(ogrenciler.Key(i) + " : " + ogrenciler.Value(i));
            }
        }