foreach enum java code example
Example 1: foreach enum
foreach (MyEnum enumValue in (MyEnum[]) Enum.GetValues(typeof(MyEnum)))
{
}
Example 2: iterate through an enum java
for (enumerator s : enumerator.values()) {
// do abc
}
Example 3: java loop through enum
for (Direction dir : Direction.values()) {
// do what you want
}