You cannot create an object of an enum explicitly so, you need to add a parameterized constructor to initialize the value(s) . The initialization should be done only once. Therefore, the constructor must be declared private or default. To returns the values of the constants using an instance method(getter).
Read moreCan enums have values Java?
The Java enum type provides a language-supported way to create and use constant values . By defining a finite set of values, the enum is more type safe than constant literal variables like String or int.2 Eyl 2021
Read more