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...

A generic class can be instantiated as any of the following base types except:

a. Character b. Array c. String d. Double

Computer Science & Information Technology

JavaScript commands are executed on a server computer

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following statements is false?

a. An advantage of inheritance over interfaces is that only inheritance provides the is-a relationship. b. Objects of any subclass of a class that implements an interface can also be thought of as objects of that interface type. c. When a method parameter is declared with a subclass or interface type, the method processes the object passed as an argument polymorphically. d. All objects have the methods of class Object.

Computer Science & Information Technology

You are the owner of a hardware store and need to keep an inventory that can tell you what different tools you have, how many of each you have on hand and the cost of each one. Write a program that initializes the shelve file "hardware.dat", lets you input the data concerning each tool and enables you to list all your tools. The tool identification number should be the record number. Use the

following information to start your file: ![15073|477x140](upload://pVMVoh5yzyMZ2zWoIMOKJxi2WSP.png) What will be an ideal response?

Computer Science & Information Technology