Beispiel #1
0
        public static void Main()
        {
            Shop sh = new Shop(3);
            sh[0] = new Laptop("Samsung", 5200);
            sh[1] = new Laptop("Asus", 4700);
            sh[2] = new Laptop("LG", 4300);

            try
            {
                foreach (Laptop LT in sh)
                    Console.WriteLine(LT.ToString());

            }
            catch (System.NullReferenceException)
            {
            }
            Console.WriteLine();
        }
Beispiel #2
0
        public static void Main()
        {
            Shop sh = new Shop(3);

            sh[0] = new Laptop("Samsung", 5200);
            sh[1] = new Laptop("Asus", 4700);
            sh[2] = new Laptop("LG", 4300);

            try
            {
                foreach (Laptop LT in sh)
                {
                    Console.WriteLine(LT.ToString());
                }
            }
            catch (System.NullReferenceException)
            {
            }
            Console.WriteLine();
        }