示例#1
0
文件: Farm.cs 项目: LSWAIN23/Farm
 public void Speaks(Goat Billy, Ox Jerry, Pig Tim, Sheep Sherry)
 {
     Console.WriteLine(Billy.Speaks());
     Console.WriteLine(Jerry.Speaks());
     Console.WriteLine(Tim.Speaks());
     Console.WriteLine(Sherry.Speaks());
 }
示例#2
0
        static void Main(string[] args)
        {
            Farm newFarm = new Farm();

            Console.WriteLine("Welcome to Earl's Farm, here are some of our animals.");
            Goat  Billy  = new Goat("Billy, I say BAAAAAHHHAHAHAHAHA");
            Ox    Jerry  = new Ox("Jerry, I say HHHHOOOOOOOOOOOOOOGGHHH");
            Pig   Tim    = new Pig("Tim, I say Oink Oink Oink");
            Sheep Sherry = new Sheep("Sherry, I say Baaaaahahaha");

            newFarm.Speaks(Billy, Jerry, Tim, Sherry);
        }