Consider the following code :
public enum MyOwnEnum {
JANVIER("janvier", "3101"),
FEVRIER("février", new DateCalculator().getLeapYear()),
MARS("mars", "3103"),
AVRIL("avril", "3004");
// Two variables, the protected constructor, getters
}
How would the code behave ? Would the method be computed directly at compile time and fixed, or would it be computed each time someone calls FEVRIER through MyOwnEnum.FEVRIER or MyOwnEnum.valueOf("FEVRIER") ? Or fixed, but at runtime ?