You can't change the String in Java as they are immutable.
You require to generate a distinct string with the character restored.
String myName = "domanokz";
String newName = myName.substring(0,4)+'x'+myName.substring(5);
Or you can try a StringBuilder:
StringBuilder myName = new StringBuilder("domanokz");