Search

What are constant variable in Java ?



The variables declared as static and final are constant variables. So only one copy of the variable exists for all instances of the class and the value can’t be changed also.
Example: static final int PI = 2.14;