title: How do you change the contents of an object in JAVA?
body: <p>I am going through a class to learn about JAVA...</p>
  
  <p>I was told to add a method (void swapNames(Greeter other)) that swaps the names of this greeter and another. Then to create two objects in the Greeter class and use the swapNames method to swap their names.</p>
  
  <p>I started with ..</p>
  
  <pre><code>public class Greeter {
  
      public Greeter(String aName){
          name = aName;
      }
  
      public String sayHello(){
          return "Hello, " + name + "!";
      }
      private String name;
  
      public void swapNames(Greeter other){
  
      }
  }
  </code></pre>
  
  <p>BUT I am getting stuck. How can I finish this "swapNames()" to change the name of the two objects?</p>