I have a class and constants are declared in it such as
final int CONST 1;
…
final int CONST 10;
Sometimes I need to change the values of constants when initializing an instance of a class.
Now I have two constructors made. The first one (without arguments) initializes the values of all constants “by default”). The second one has the values of all variables in the arguments, which are then assigned to constants.
The problem is that I often need to change the values of only one constant or two, three constants during initialization out of 10. And to do this, you have to take the second constructor and also specify the values of the remaining 8, 7 (often I don’t even remember their values). It’s inconvenient.
Is there a way to initialize (change) the values of some constants, and set the rest “by default”?
I looked on the Internet and on the forum, but I didn’t find anything