I\'m familiar with the idea and benefits of a static factory method, as described in Joshua Bloch\'s Effective Java:
The textbook example of your second point is Integer.valueOf(int) (similar for Boolean
, Short
, Long
, Byte
). For parameter values -128 to 127, this method returns a cached instance instead of creating a new Integer
. This makes (auto)boxing/unboxing much more performant for typical values.
You can't do that with new Integer()
since the JLS requires that new
create a new instance every time it is called.