コード例 #1
0
ファイル: Program.cs プロジェクト: ClarkChen633/MyCSharp
 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
ファイル: Program.cs プロジェクト: zhangabc/third-edition
        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();
        }