yes there is. A compile time constant is a constant that gets set at compilation. A runtime constant gets set at runtime.

The second case is a runtime constant. Its value could be anything, typically it might be the ip address of the machine you're running on for example, determined at application startup, or some other system setting. That's a value that doesn't change while the application is running, but can't be determined on compilation so it's determined once when first needed (say in a static initialiser block) and then just used.

Also, I would say that while compile-time constant expression is a fairly well-defined term, "constant" by itself is not. In Java, at least. Often when people say "constant" they mean a compile-time constant expression. However some other people simply mean a final variable (preferably of primitive or immutable type), which may or may not be a compile-time constant. The JLS has never given a general definition of "constant". Thus, whenever you see the term, you should be a bit careful to check: what does the person using the term really mean?

If the value is set at compile-time, you will probably get the compiler using 90 instead of i throughout. Have a look at the method's bytecode with the javap -c instructions. In the second example, the bytecode uses "i". The compiler cannot follow the execution through the whole method; that would be too complicated to program.