コード例 #1
0
        static void Main(string[] args)
        {
            Dog aDog = new Dog();
            Console.WriteLine(aDog.ToString());

            Dog myDog = new Dog("Fido");
            myDog.Weight = 45;
            myDog.Noise();
            Console.WriteLine(myDog.ToString());

            Cat myCat = new Cat("Pus");
            myCat.Weight = 12;
            myCat.Noise();
            Console.WriteLine(myCat.ToString());
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Dog aDog = new Dog();

            Console.WriteLine(aDog.ToString());

            Dog myDog = new Dog("Fido");

            myDog.Weight = 45;
            myDog.Noise();
            Console.WriteLine(myDog.ToString());

            Cat myCat = new Cat("Pus");

            myCat.Weight = 12;
            myCat.Noise();
            Console.WriteLine(myCat.ToString());
        }