enum MyEnum {
A( 1, 2, 3, 4),
B(1, 2),
C(4, 5, 8, 8, 9);
private MyEnum( int firstInt, int... otherInts ) {
// do something with arguments, perhaps initialize a List
}
}
Are there any problems with this? Any reasons not to do it?
enum MyEnum {
A( 1, 2, 3, 4),
B(1, 2),
C(4, 5, 8, 8, 9);
private MyEnum( int firstInt, int... otherInts ) {
// do something with arguments, perhaps initialize a List
}
}
Are there any problems with this? Any reasons not to do it?
Sure, this is perfectly legal. No reason not to do it if your program requires it.
it does work. You should try to
private MyEnum(int... Ints )
With enums you need to make sure that you access them in a manner the initializes them. A lot of the time an access is all that is needed
MyEnum bob = MyEnum.A;