摘要: 在.NET下,当我们在定义某个集合类型时,要在这个集合类型上面实现foreach迭代,需要进行实现IEnumerable,再进一步实现IEnumerator接口。如MSDN上面的代码:View Code 1 using System; 2 using System.Collections; 3 4 public class Person 5 { 6 public Person(string fName, string lName) 7 { 8 this.firstName = fName; 9 this.lastName = lName;10 }11 12 public string fir. 阅读全文
posted @ 2011-02-24 09:59 雁北飞 阅读(422) 评论(0) 推荐(0)