Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| //<Snippet1> | |
| using System; | |
| using System.Collections.Generic; | |
| class Base | |
| { | |
| public static void PrintBases(IEnumerable<Base> bases) | |
| { | |
| foreach(Base b in bases) | |
| { | |
| Console.WriteLine(b); | |
| } | |
| } | |
| } | |
| class Derived : Base | |
| { | |
| public static void Main() | |
| { | |
| List<Derived> dlist = new List<Derived>(); | |
| Derived.PrintBases(dlist); | |
| IEnumerable<Base> bIEnum = dlist; | |
| } | |
| } | |
| //</Snippet1> | |