DEV Community

Discussion on: StringBuilder is implicitly used when there is String += in Java

Collapse
 
alainvanhout profile image
Alain Van Hout

I think you might have misunderstood what the compilation step actually does: when you have lots of string concatenations, the compilation step will optimise that into a StringBuilder-based approach. The point there is that you no longer need to (always) do these kinds of micro-optimisations yourself. You can rely on the compiler.