示例#1
0
        static void Main(string[] args)
        {
            Bear b = new Bear();
            Chicken c = new Chicken();
            Eagle e = new Eagle();

            AnimalUtility.DoSomething(b);
            AnimalUtility.DoSomething(c);
            AnimalUtility.DoSomething(e);

            //pause
            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Bear    b = new Bear();
            Chicken c = new Chicken();
            Eagle   e = new Eagle();

            AnimalUtility.DoSomething(b);
            AnimalUtility.DoSomething(c);
            AnimalUtility.DoSomething(e);

            //pause
            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            Bear bear = new Bear();
            bear.Name = "Brown Bear";

            Eagle eagle = new Eagle();
            eagle.Name = "Bald Eagle";

            Chicken chicken = new Chicken();
            chicken.Name = "Rooster";

            AnimalUtility.DoSomething(bear);
            AnimalUtility.DoSomething(eagle);
            AnimalUtility.DoSomething(chicken);

            Console.ReadLine();
        }
示例#4
0
        static void Main(string[] args)
        {
            Bear bear = new Bear();

            bear.Name = "Brown Bear";

            Eagle eagle = new Eagle();

            eagle.Name = "Bald Eagle";

            Chicken chicken = new Chicken();

            chicken.Name = "Rooster";

            AnimalUtility.DoSomething(bear);
            AnimalUtility.DoSomething(eagle);
            AnimalUtility.DoSomething(chicken);


            Console.ReadLine();
        }
示例#5
0
 public static void Main(string[] args)
 {
     var name = new Bear();
     AnimalUtility.DoSomething(name);
     Debug.Assert(new Bear().Name == "Bear", "Bear isnt a bear :(");
     Console.ReadLine();
 }