String replace(char oldChar, char newChar)
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
String replace(CharSequence target, CharSequence replacement)
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.
String replaceAll(String regex, String replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement.
There are two 'replace' methods, and one 'replaceAll' method. the first replace method takes a SINGLE CHARACTER, and replaces it with a SINGLE CHARACTER.
The second will take a CharSequence - basically a string - and will replace it with another string (note - I used a little 's' there on purpose).
Finally, the 'replaceAll' takes a regular expression, which lets you do much more powerful substitutions, and replaces it with a String. So you could pass "r.n" and it would replace "run", "ran", or "ron" (or many other things) with what you supply.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors