Possible Duplicate:
private final static attribute vs private final attribute
What’s the difference between declaring a variable as
static final int x = 5;
or
final int x = 5;
If I only want to the variable to be local, and constant (cannot be changed later)?
Thanks
Just having
finalwill have the intended effect.Declaring static is making it a class variable, making it accessible using the class name
<ClassName>.x