String s = \"hello\"; String backup_of_s = s; s = \"bye\";
At this point, the backup variable still contains the original value \"hello
Second case is also inefficient in terms of String pool, you have to explicitly call intern() on return reference to make it intern.