示例#1
0
        static void Main(string[] args)
        {
            SimpleReturn <Dog> dogReturner = new SimpleReturn <Dog>();

            dogReturner.items[0] = new Dog()
            {
                Name = "Avonlea"
            };

            //SimpleReturn<Animal> animalReturn = dogReturner;

            //IMyIfc<Dog> dogIMyIfc = dogReturner;
            //Console.WriteLine(dogIMyIfc.GetFirst().Name);

            IMyIfc <Animal> animalIMyIfc = dogReturner;

            Console.WriteLine(animalIMyIfc.GetFirst().Name);

            //DoSomething(dogReturner);
        }
示例#2
0
 static void DoSomething(IMyIfc <Animal> returner)
 {
     Console.WriteLine(returner.GetFirst().Name);
 }