I have an enum
in Java for the cardinal & intermediate directions: (我有一个Java的enum
主要和中间方向:)
public enum Direction {
NORTH,
NORTHEAST,
EAST,
SOUTHEAST,
SOUTH,
SOUTHWEST,
WEST,
NORTHWEST
}
How can I write a for
loop that iterates through each of these enum
values? (如何编写迭代这些enum
值的for
循环?)