java iterate over enum code example
Example 1: java iterate enum
for (EnumClass value : EnumClass.values()) {
System.out.println(value);
}
Example 2: java loop through enum
for (Direction dir : Direction.values()) {
// do what you want
}