摘要: 实现了IEnumerable的对象才能用foreach遍历。foreach只管GetEnumerator方法。 GetEnumerator如果是实现的接口,就必须返回一个IEnumerator的引用。 定义一个person类 这个类的集合实现IEnumerable接口,里面要有一个GetEnumer 阅读全文
posted @ 2017-05-11 09:14 jechsky 阅读(255) 评论(0) 推荐(0) 编辑