为什么我不能在Java枚举上使用foreach循环?

18 浏览
0 Comments

为什么我不能在Java枚举上使用foreach循环?

为什么不能这样做:

Enumeration e = ...
for (Object o : e)
  ...

0