C#,若想支持Foreach语句需要实现的接口是什么?为什么?

如题所述

IEnumerable
只有实现IEnumerable接口的自定义类数组才支持迭代,没有为什么,微软msdn里有介绍。
温馨提示:答案为网友推荐,仅供参考