How is the constant concatenation in java? Also through StringBuilder, like ordinary strings? Are they optimized at the compilation stage if only constants are concatenated (say, into one big constant)?

Thank.

    1 answer 1

    Optimized. As a result, there will be one constant. Compile and look at the bytecode.