經安全檢測,此網站為安全網站,請放心前往原始網址!

Compare Java enum values - Stack Overflow

All Java enums implements Comparable: http://java.sun.com/javase/6/docs/api/java/lang/Enum.html You can also use the ordinal method to turn them into ints, then comparison is trivial. if (ErrorLevel.ERROR.compareTo(someOtherLevel) ...

stackoverflow.com

網址安全性掃描由 google 提供