Should a private final field be static too?

java, static

Solution

If every instance of your class should have the same immutable value for foo, then you should make foo final and static. If each instance of your class can have a different (but still immutable) value for foo, then the value should just be final.

However, if every instance of your class should have the same immutable value for foo, then it is a really a constant. By convention, that is typically coded as follows:

private static final int FOO = ...

Note the caps to denote a constant...

Problem

I was wondering, if I have this field in my class : `private final int foo = ...`, should I put it in static `private static final int foo = ...`? Because if it's static, it's common to all the instances of my class, and will never change. Is there a reason to not put it in static? Or do I have to put it in static?

Original source