Java Programming Example of how to replace old character with new character in the string?

This program accepts the string, old character and new character from the keyboard and replaces the old character with new character in the string.

import java.io.*;

/**
 *
 * @author JavaHotSpot
 */
public class stringReplace
{
    public static void main(String args[])
 {

     String s1,s2,s3,s4;
     DataInputStream d;
     try
     {
     System.out.println("Enter the String to be manipulated");
     d=new DataInputStream(System.in);
     s1=(String)d.readLine();
     System.out.println("Enter the Old Character");
     s2=(String)d.readLine();
     System.out.println("Enter the New Character");
     s3=(String)d.readLine();
     s4=s1.replace(s2, s3);
      System.out.println("The String after manipulation "+s4);
     }
     catch(Exception e)
     {
         System.out.println(e.toString());
     }
 }
}
Output:
Enter the String to be manipulated
Hello word
Enter the Old Character
word
Enter the New Character
Java
      The String after manipulation Hello Java