Code:
public class EnumTest {
public enum MyEnum {
One,
Two,
Three
}
public static void main(String[] args) {
for (MyEnum e : MyEnum.values()) {
System.out.println(e);
}
}
}
What is the most elegant way to change the foreach loop to go in reverse order?
I was thinking about using Collections.reverse, but have been unable to come up with a clean way to use it. Any help would be appreciated.