Back
What is the correct way to cast an Int to an enum in Java given the following enum?
public enum MyEnum{ EnumValue1, EnumValue2}MyEnum enumValue = (MyEnum) x; //Doesn't work???
public enum MyEnum
{
EnumValue1,
EnumValue2
}
MyEnum enumValue = (MyEnum) x; //Doesn't work???
31k questions
32.8k answers
501 comments
693 users