final
.
Using the final
variable makes code more error-prone. It may also be helpful for compiler optimisations
that make your program run faster.
A field may be safely made final
only if it has the private
access modifier
(or it is defined in a local / anonymous class) and:
static
and initialized either in its declaration or in one static class initializer.