Java has inbuilt methods that can be used to replace a character or a group of characters with other characters in a string such as replace() method. Replace function can be used in many applications to change a single character, word or several words in a paragraph or document. It has been used in many word processing applications such as Microsoft Word.