Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
Yea, for primitive wrappers use the .valueOf() expression for using the pool, like Boolean.valueOf(true) instead of new Boolean(true).
Strings are handled more automatically, based on your usage. I would recommend to use StringBuilder.append("...") instead of variable += "..." mainly when it occurs more than one times (in a loop). There are pools, but I don't think they are accessible by the programmer easily (if any way).