The whole question is in the title. For example:
enum enumTest { TYPE1(4.5, "string1"), TYPE2(2.79, "string2"); double num; String st; enumTest(double num, String st) { this.num = num; this.st = st; } }
The constructor is fine with the default or private modifier, but it gives me a compiler error if public or protected modifiers are given.
java enums constructor
Bad Request Sep 08 2018-10-10T00: 00Z
source share