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’.
You might also like to view...
Which of the following statements is true?
a) Methods and instance variables can be public, protected or private. b) Information hiding is achieved by restricting access to class members via keyword public. c) The public members of a class are not directly accessible to the client of a class. d) None of the above is true.
The Object class is not a superclass of Math class.
Answer the following statement true (T) or false (F)
Which of the following methods automatically iterates once for each item stored in an array?
A. each B. while C. until D. next
A(n) __________ risk is one that is higher than the risk appetite of the organization.
Fill in the blank(s) with the appropriate word(s).