static final variable in java code example

Example 1: what it means when create final variable in java

First of all, final is a non-access modifier applicable only to 
a variable, a method or a class

When a variable is declared with final keyword, its value can’t be modified, 
essentially, a constant. This also means that you must initialize a 
final variable. If the final variable is a reference, this means that 
the variable cannot be re-bound to reference another object, but internal 
state of the object pointed by that reference variable can be changed 
i.e. you can add or remove elements from final array or final collection. 
  It is good practice to represent final variables in all uppercase, using 
  underscore to separate words.

Example 2: static and final in java

The two really aren't similar. 
"STATIC" fields are fields that do not 
belong to any particular instance of a class.
and there is only one copy of the variable in memory
shared by all instances of the class.
On the other hand
"FINAL" The final keyword just means the value
can't be changed. Without final, any object can 
change the value of the variable

Tags:

Java Example