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 this?
Of course, this is completely legal. There is no reason not to do this if your program requires it.
it works. You must try
private MyEnum(int... Ints )
With enumerations, you must make sure that you access them the way they are initialized. A lot of time access is all it takes
MyEnum bob = MyEnum.A;