I get that one should try to use Boolean.valueOf() instead of new Boolean() as much as possible since creating new instances of Boolean wastes memory.
However, the Boolean API for valueOf() states:
If a new Boolean instance is not required, this method should generally be used in preference to the constructor Boolean(boolean), (...)
When would a new Boolean instance be required? Boolean objects are immutable, and there are only two useful values; Boolean.TRUE and Boolean.FALSE ..
Am I missing something here?
[ June 29, 2004: Message edited by: Mark Sintrel ]