Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor grammar changes

...

The final keyword in Java is used to declare constants. Its effect is to render the affected non-composite variable immutable. Attempts to change the value of a final-qualified variable after it has been initialized result in a compile-time error. Because 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. (See guideline DCL04-J. Do not apply public final to public constants whose value might change in the future.)

...