摘要: IEnumerable 接口只包含一个抽象的方法 GetEnumerator(),它返回一个可用于循环访问集合的 IEnumerator 对象,IEnumerator 对象是一个集合访问器。 需要给自定义的类实现 foreach 功能,就需要实现 IEnumerable 接口,下面给出一个例子。 手 阅读全文
posted @ 2015-10-29 17:22 轻典 阅读(295) 评论(0) 推荐(0) 编辑