Beispiel #1
0
        static void Main(string[] args)
        {
            // Declare an instance of the SampleCollection type.
            SampleCollection <string> stringCollection = new SampleCollection <string>();
            int i = 0;

            while (true)
            {
                // Use [] notation on the type.
                stringCollection[0] = "Hello, World";
                System.Console.WriteLine(stringCollection[0]);
                System.Console.WriteLine(i++);
                Thread.Sleep(3000);
                Console.WriteLine();
            }
        }
        static void Main(string[] args)
        {
            var stringCollection = new SampleCollection <string>();

            stringCollection[0] = "Hello, World";
            Console.WriteLine(stringCollection[0]);

            var stringCollectionX = new SampleCollectionX <string>();

            stringCollectionX.Add("Hello, World");
            System.Console.WriteLine(stringCollection[0]);


            var obj = new SampleCollection <Student>();

            obj[0].Id   = 173015026;
            obj[0].Name = "Rafiul Islam";

            obj[1].Id   = 173015035;
            obj[1].Name = "Naymul Haque";

            System.Console.WriteLine(obj[0]);
        }