In Java, when should static non final variables be used?
For example
private static int MY_VAR = 0;
Obviously we are not talking ab
When used as a cache, logging, statistics or a debug switch are the obvious reasonable uses. All private, of course.
If you have mutable object assigned to a final field, that is morally the same as having a mutable field.
Some languages, such as Fan, completely disallow mutable statics (or equivalent).