Почему вы используете String1, String2 в кавычках?
Замените это:
String replaceString=String3.replaceAll("String1","String2");
На это:
String replaceString=String3.replaceAll(String1,String2);
Кстати, согласно соглашениям об именах, переменные всегда именуются, начиная с буквы нижнего регистра.так что все должно выглядеть так:
public static void main(String[] args) {
Scanner a = new Scanner(System.in);
System.out.println("Enter your first word:");
String firstWord = a.nextLine();
Scanner b = new Scanner(System.in);
System.out.println("Enter your second word:");
String secondWord = b.nextLine();
Scanner c = new Scanner(System.in);
System.out.println("Enter your sentence:");
String sentence = c.nextLine();
c.close();
String updatedSentence = sentence.replaceAll(firstWord, secondWord);
System.out.println(updatedSentence);
}
Подробнее об этом вы можете прочитать здесь: https://www.javatpoint.com/java-naming-conventions