previous | start | next

Constant Declarations

Variable can be declared as constant so that no subsequent changes are allowed. The purpose is to have a symbolic name for a value that indicates more clearly its use.

Java syntax:

        final int MAX_SCORE = 120;

        MAX_SCORE = 100; // ERROR!
     


previous | start | next