Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
 }