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.
Strings are immutable objects so you can copy them just coping the reference to them, because the object referenced can’t change …
So you can copy as in your first example without any problem :
String s = “hello”;
String backup_of_s = s;
s = “bye”;