摘要: 1.迭代器:可使用Foreach遍历,如List,Dictionary等,其继承IEnumerable接口,并实现public IEnumerator GetEnumerator()方法; 举例:有个动物园,其中有各种动物: public class Zoo : IEnumerable { List 阅读全文
posted @ 2023-05-20 11:31 [春风十里] 阅读(74) 评论(0) 推荐(0) 编辑