String s = \"hello\"; String backup_of_s = s; s = \"bye\";
At this point, the backup variable still contains the original value \"hello
Your second version is less efficient because it creates an extra string object when there is simply no need to do so.
Immutability means that your first version behaves the way you expect and is thus the approach to be preferred.