...
Constants should be declared as static
and final
. However, constants should not be declared public and final if their values might change (see 31 DCL59-J. Do not apply public final to constants whose value might change in later releases for more details). For example,
...
Although final
can be used to specify immutable constants, there is a caveat when dealing with composite objects. See 73OBJ50. Never confuse the immutability of a reference with that of the referenced object for more details.
...