"555" + ""
is a compile-time constant, whereas
giveLiteralString() + ""
isn’t. Therefore the former compiles into just the string constant “555” and the latter compiles into the actual method invocation and concatenation, resulting in a fresh String instance.
Also see JLS ยง3.10.5 (String Literals):
Strings computed by concatenation at run time are newly created and
therefore distinct.