
Constants in Java
Even though Java does not have a constant type, you can achieve the same effect by declaring and initializing variables that are static, public, and final. After the variables have been initialized, their value cannot be changed. You can then access the constant value using the name of the variable