Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("***Constructor overloading Demo***\n\n");
            ConsOverloadEx ob1 = new ConsOverloadEx();
            ConsOverloadEx ob2 = new ConsOverloadEx(25);
            ConsOverloadEx ob3 = new ConsOverloadEx(10, 25.5);

            //ConsOverloadEx ob4 = new ConsOverloadEx(37.5);//Error
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("*** コンストラクタのオーバーロードのデモ ***");
            ConsOverloadEx ob1 = new ConsOverloadEx();
            ConsOverloadEx ob2 = new ConsOverloadEx(25);
            ConsOverloadEx ob4 = new ConsOverloadEx(10, 25.5);

            //ConsOverloadEx ob4 = new ConsOverloadEx(25.5); //エラー
            Console.ReadKey();
        }