Question: Make the following updates to the Greeter class in chapter 1 a. Write a new method for the Greeter class, public void swapNames(Greeter other) {...}

Make the following updates to the Greeter class in chapter 1 a. Write a new method for the Greeter class, public void swapNames(Greeter other) {...} that swaps the names of this greeter and another instance. b. Write a new method for the Greeter class: public Greeter createQualifiedGreeter(String qualifier) { ..... } that returns a new Greeter object with its name being the qualifier string followed by " " and the executing greeter's name (i.e. this.name). For example: Greeter g = new Greeter("world"); Greeter g2 = g.createQualifiedGreeter("beautiful"); g2.name will be the string "beautiful world" c. Write a GreeterTester class that shows how the swapNames() and the createQualifiedGreeter() methods are used. Write javadoc comments. Include both java files in your solution document.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!