Java Data Type How to - Java enum Example

  1. Java Add Constructors/Member method to an enum
  2. Java Collections.sort, Enum, Comparable Interface
  3. Java Compare enum members: == or equals()
  4. Java Compare two enum data type variables
  5. Java Convert String to enum value when enum type reference is a Class
  6. Java Create Comparator for enum value
  7. Java Create EnumMap with its constructor
  8. Java Create enum with enum in constructor
  9. Java Create Self referential enum with immutable parameters
  10. Java Customize sort of Enum value
  11. Java Get all ordinal values using ordinal()
  12. Java Get a random value from an enum
  13. Java Get enum by its inner field
  14. Java Get enum value from a string constant
  15. Java Get next in static enum
  16. Java List all enum values in a enum type
  17. Java Loop through "Color" enum and printing values. Different ways of doing it
  18. Java Map Enum Keys to Enum Values
  19. Java Order enum values
  20. Java Return a class' enums from its own class
  21. Java Set the value of an enum by user input
  22. Java Shift int enums
  23. Java Store enum in ArrayList
  24. Java Switch with enum
  25. Java Use enum inside a switch


  1. Java Get enum name from enum value