There actually are three Strings that are created:
- "Hello" created on line 2
- "Pal" created on line 4
- combination of the two also created on line 4
So each
String literal is created as a String object before it is used. And because Strings are immutable the combination of the two Strings is a whole new one.