List GetEnumerator

 static void Main()
    {
    List<int> list = new List<int>();
    list.Add(1);
    list.Add(5);
    list.Add(9);

    List<int>.Enumerator e = list.GetEnumerator();
    Write(e);
    }

    static void Write(IEnumerator<int> e)
    {
    while (e.MoveNext())
    {
        int value = e.Current;
        Console.WriteLine(value);
    }
    }

 

posted @ 2015-07-10 09:39  等待是一生最初的苍老  阅读(485)  评论(0编辑  收藏  举报