> Online tutorial : Constants in java
Showing posts with label Constants in java. Show all posts
Showing posts with label Constants in java. Show all posts

Constants in java

Constants
A Constants is a named memory location whose value cannot change while the program is running.

Constants are named using identifiers as described above and identified by the keyword final.

final int MAX = 100;
final double PIE = 3.14;
final int MAX_INPUT = 100;

It is common practice in Java, but not a requirement, to name constants with all upper case letters, as shown above.