The expression
"string1" + "string2"
will result in a string constant
"string1string2"
created at compile time and added to the enclosing class's constant pool.
The expression
string1 + string2
where string1
and string2
are arbitrary String
-typed variables will compile into executable code which concatenates two strings. The result is not committed to the pool.