Consider the following example.
String str = new String(); str = \"Hello\"; System.out.println(str); //Prints Hello str = \"Help!\"; System.out.println(s
Regarding the replace part of your question, try this:
String str = "Mississippi"; System.out.println(str); //Prints Mississippi String other = str.replace("i", "!"); System.out.println(str); //still prints Mississippi System.out.println(other); // prints M!ss!ss!pp!