What is a Compile Time Constant in Java ?

A compile time constant is public static final variable. The public modifier is optional here. At compile time, they are replaced with actual values because compiler knows their value up-front and it also knows that it cannot be changed during run-time. So they are constants.



You May Interest

How Will You Handle InterruptedException in Java ?

What are the Differences Between a Vector and an ArrayList in Jav ...

Why Did Oracle Release a New Version of Java Like Java 8 ?

Why ListIterator Has add Method But Iterator Does Not Have in Jav ...

What is Thread Starvation in Java ?