ordinal tag

1 questions


1 answers
150 views
0
Is it possible to cast int as enum in Java?

public enum MyEnum{ EnumValue1, EnumValue2}MyEnum enumValue = (MyEnum) x; //Doesn't work???How can I cast int as enum?

2 years ago

© 2024 OneMinuteCode. All rights reserved.