How to define a constant variable?
To define a constant in Java, use final modifier which combined with static modifier. The final modifier indicates that the value of this field cannot change.
If you change the value of the constant, you need to recompile the class to get the current value. Other feature in Java that provide similar functionality is enumeration (a list of named constants). You can simply create an enumeration by using the enum keyword.