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

What is the Difference Between StringBuffer and StringBuilder in ...

What are the Uses of Optional in Java ?

How Can We Analyze the Dependencies in Java Classes and Packages ...

Why Do We Use JSP Instead of Servlet in Java ?

Why an Object Used as Key in HashMap Should Be Immutable in Java ...