コード例 #1
0
ファイル: Program.cs プロジェクト: xs2ranjeet/13ns9-1spr
        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();
        }
コード例 #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();
        }