According to the last entry here :
"If a primitive type or string is defined as a constant and the value is known at compile time, the compiler replaces the constant name everywhere in the code with its value. This is called the compile time constant. The value of the constant in the outside world changes (for example, if it is assumed that pi actually should be 3.975), you will need to recompile any classes that use this constant to get the current value.
Suppose I defined a public constant PI ( public static final double PI=3.14 ) in class A , and used this PI constant from class B
So - according to the above specification, if I change the PI value from 3.14 to, say, 3.0 in class A , I need to recompile class B to get the effect of this change in class B ,
here Q - what is the definition of "constant" in the above specification? is this the final keyword? does any member of the static field qualify as a constant in this context? non-static field members will be out of context here - their values are assigned at runtime (?)
TIA.
// =============================
EDIT:
Here's Q: what the compiler does is decide to bind the value at compile time. The static does this work on its own. or is there something else in it.
// =========================
in connection with a quick reply below that continues to vote:
line on the same page:
"The static modifier, in combination with the final modifier, is also used to define constants. The last modifier indicates that the value of this field cannot be changed."
1.) "... is also used to define constants ....": what else defines a constant.
2.) "... combined with the final modifier": final necessary to make the value attached at compile time - which I doubt it.