Answer:
public class Printing
{
public static void main(String[] args)
{
String letters = "Hello, World!";
String letters2 = letters.replace("o" , "e");
String letters3 = letters.replace("e" , "o");
System.out.println(letters3);
}
}
Step-by-step explanation:
We start by defining a class called Printing. We take a string variable to store "Hello, World!";. Then we use replace method 2 times to switch the letters "e" and "o". Finally we print the last String variable where the latest replacement is stored.