IEnumerable接口使用

要使用foreach语句对对象遍历,对象必须实现IEnumerable接口,下面是一个Demo。

 

结果:

你可能感兴趣的:(enum)