public class StringReplace {
public static void main(String[] args) {
String message = "Hi everyone!";
System.out.println("message = " + message.replace("e", "X")); }
}
What is the result?
A.
message = Hi everyone!
B.
message = Hi XvXryonX!
C.
A compile time error is produced.
D.
A runtime error is produced.
E.
message =
F.
message = Hi Xveryone!
think A is correct answer
strings are immutable so value can’t be altered.
It would work if using a sring builder.
B is correct.
You can try to compile it.