Just having final
will have the intended effect.
final int x = 5;
...
x = 10; // this will cause a compilation error because x is final
Declaring static is making it a class variable, making it accessible using the class name <ClassName>.x
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…