Java Final Term and Constants

When you want to use a constant instead of a variable in java language, the final word is added to the beginning of the definition. Once the value of the constants defined as finals is given, they cannot be changed.
 

final double pi = 3.14;  // The constant of pi is defined.

 

Tagged In:

Software developer

26 Total Posts