Java: Convert enum to and from int

enum → int

yourEnum.ordinal()

int → enum

YourEnum.values()[yourInt]

Comments (1)

User avatar

Thanks

by Babin Vyacheslav |  Reply

Add comment