title: Error printing out fields of geolocation object
body: <pre><code>import java.util.*;
  
  public class RoadTrip
  {
      ArrayList&lt;GeoLocation&gt; roadTrip = new ArrayList&lt;GeoLocation&gt;();
  
      double cheat = 0;
  
      // Create a GeoLocation and add it to the road trip
      public void addStop(String name, double latitude, double longitude)
      {
          GeoLocation loc = new GeoLocation(name + " ", latitude, longitude);
          roadTrip.add(loc);
      }
  
      // Get the total number of stops in the trip
      public int getNumberOfStops()
      {
          return roadTrip.size();
      }
  
      // Get the total miles of the trip
      public double getTripLength()
      {
          double totalDistance = 0;
          for (int i = 1; i &lt; roadTrip.size(); i++ )
          {
              GeoLocation here = roadTrip.get(i);
              GeoLocation prev = roadTrip.get(i-1);
              totalDistance = totalDistance + here.distanceFrom(prev);
          }
          return totalDistance;
      }
  
      // Return a formatted toString of the trip
      public String toString()
      {
          int i = 0;
          String retVal="";
          for( Object test: roadTrip)
          {
  
              retVal = retVal + ( i + 1 ) + ". " + test + "\n";
              i++;
          }
          return retVal;
      }
  }
  </code></pre>
  
  <p>When I return retVal, it returns the values </p>
  
  <ol>
  <li>Powder Springs(-110.97168, -110.97168)</li>
  <li>Argonne(-149.00134, -149.00134)</li>
  <li>Zeba(-84.74096, -84.74096)</li>
  <li>Hyampom(-53.2522, -53.2522)</li>
  <li>North Fairfield(47.05816, 47.05816)</li>
  </ol>
  
  <p>When it should return </p>
  
  <ol>
  <li>Powder Springs (70.47312, -110.97168)</li>
  <li>Argonne (-12.26804, -149.00134)</li>
  <li>Zeba (-3.89922, -84.74096)</li>
  <li>Hyampom (84.57072, -53.2522)</li>
  <li>North Fairfield (73.14154, 47.05816)</li>
  </ol>
  
  <p>The problem is that the latitude value is for some reason equal to the longitude value.</p>
  
  <p>EDIT: Forgot I was messing with the code and removed the latitude part, put it back in; still gives the same result</p>