A final field in a singleton class should be constant (assuming immutability) regardless of whether it is static, as there cannot be multiple instances of the class holding different values.
Are there reasons to still declare the field as static, or not to do so?
One reason to make it static is clear declaration of intent. But are there nuances regarding memory management that could make one practice best?
To my understanding, what differs is that in the non-static case, the reference to the object assigned to the field is stored in the class instance in heap space, while in the static case it's stored in metaspace, but I don't know which one (if any) is to be preferred.
Edit: A user noted that the implementation of the singleton may make a difference. This question came up regarding Spring components, where manually creating multiple instances could be done, but will not happen in practice.