A constant is a class member that represents a constant value: a value that can be computed at compile-time. Constants are permitted to depend on other constants within the same program, as long as there are no circular dependencies. The rules governing constant expressions are defined in 14.15. The example shows a class named Constants that has two public constants.
Even though constants are considered static members, a constant declaration neither requires nor allows the modifier static. Constants can be accessed through the class, as in which prints out the values of Constants.A and Constants.B, respectively.