String s = \"hello\"; String backup_of_s = s; s = \"bye\";
At this point, the backup variable still contains the original value \"hello
Since strings are immutable, both versions are safe. The latter, however, is less efficient (it creates an extra object and in some cases copies the character data).
With this in mind, the first version should be preferred.