コード例 #1
0
        static void Main(string[] args)
        {
            Canine spot = new Canine("Spot", "pug");
            Canine bob = spot;
            bob.Name = "Spike";
            bob.Breed = "beagle";
            spot.Speak();

            Dog jake = new Dog("Jake", "poodle");
            Dog betty = jake;
            betty.Name = "Betty";
            betty.Breed = "pit bull";
            jake.Speak();

            Console.ReadKey();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Canine spot = new Canine("Spot", "pug");
            Canine bob  = spot;

            bob.Name  = "Spike";
            bob.Breed = "beagle";
            spot.Speak();

            Dog jake  = new Dog("Jake", "poodle");
            Dog betty = jake;

            betty.Name  = "Betty";
            betty.Breed = "pit bull";
            jake.Speak();

            Console.ReadKey();
        }