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.