When you write final Object reference = someObject;
, reference is a constant reference to someObject
. It will always "point" to that object.
However it does not mean that someObject
itself is constant.
For example, in final List list = new ArrayList();
, list is a constant that will always refer to the same list, but you can add/remove to that list.
In your example, both Integer
and BigInteger
are immutable so both the reference and the referenced object are constant.
Note however that the JLS has a precise definition of what constitutes a constant expression, which only includes primitives and String.