public enum Code {
1234("1234"),
2345("2345"),
3456("3456"),
…
As Java does not accept numeric for Java : « A variable's name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character "_" »
I think the simplier way would be to add a "_" before each constant in the enum in these cases.
I have an enum with this kind of values :
The generation gives :
As Java does not accept numeric for Java : « A variable's name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character "_" »
I think the simplier way would be to add a "_" before each constant in the enum in these cases.
Version used : 5.3.3