1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
using System; using System.Collections; public class Test { public static void Main () { foreach (object o in new Test ()) Console.WriteLine (o); } public IEnumerator GetEnumerator () { int i = 2; yield return 3; } }