Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The final keyword in Java is used to declare constants. Its effect is to render the affected non-composite variable immutable. Attempting to change the value of a final-qualified variable results in a compile-time error. As constants cannot be changed, it is desirable to define only one instance of them for the class; consequently constants should also be declared with the static modifier. (DCL31DCL04-J. Qualify mathematical constants with the static and final modifiers)

...