java cycle through enum and go back to beginning code example
Example 1: iterate through an enum java
for (enumerator s : enumerator.values()) {
// do abc
}
Example 2: java loop through enum
for (Direction dir : Direction.values()) {
// do what you want
}