Java: Convert enum to and from int

enum → int

yourEnum.ordinal()

int → enum

YourEnum.values()[yourInt]

Comments