What output is produced by the following code fragment?
```
String m1, m2, m3;
m1 = "Quest for the Holy Grail";
m2 = m1.toLowerCase();
m3 = m1 + " " + m2;
System.out.println(m3.replace('h', 'z'));
```
The output produced is:
Quest for tze Holy Grail quest for tze zoly grail
The original string is concatenated with a lowercase version of itself, then all lowercase ‘h’ characters are replaced with ‘z’.
Computer Science & Information Technology
You might also like to view...
Encrypting data is not an appropriate measure for protecting mobile devices such as smartphones
Indicate whether the statement is true or false
Computer Science & Information Technology
The two parts of an email address are separated with the ________ symbol
A) ! B) ? C) @ D) &
Computer Science & Information Technology