title: How to use compareTo to compare strings to get names in alphabetical order instead of scores?
body: <p>I have to use the given codes and alter it so that instead of returning results by comparing scores, it should return the data input by the names in alphabetical order. </p>
  
  <p>Here is the <a href="https://www.dropbox.com/s/x0nm23dj4kti4p4/GolfAppsFiles.zip?dl=0" rel="nofollow">ZIP FILE</a></p>
  
  <p>Here are my results when I run the GolfApp2 file:</p>
  
  <pre><code> ----jGRASP exec: java GolfApp2
  
  Golfer name (press Enter to end): Annika
  Score: 72
  Golfer name (press Enter to end): Grace
  Score: 75
  Golfer name (press Enter to end): Arnold
  Score: 68
  Golfer name (press Enter to end): Vijay
  Score: 72
  Golfer name (press Enter to end): Christie
  Score: 70
  Golfer name (press Enter to end): 
  
  The final results are
  68: Arnold
  70: Christie
  72: Vijay
  72: Annika
  75: Grace
  
   ----jGRASP: operation complete.
  </code></pre>
  
  <p>Here's what I have changed in the Golfer file:</p>
  
  <pre><code> public int compareTo(Golfer other)
     {
        if (this.name.compareTo(other.getName()))
           return -1;
        else 
           if (this.name == other.name)
              return 0;
           else 
              return +1;
     }
  </code></pre>
  
  <p>I am confused on how to change it so that instead of...</p>
  
  <pre><code>public int compareTo(Golfer other)
    {
      if (this.score &lt; other.score)
        return -1;
      else 
        if (this.score == other.score)
          return 0;
        else 
          return +1;
    }
  </code></pre>
  
  <p>...it would compare the names.</p>