title: compareTo causes stack overflow
body: <p>I wrote a class Day and now I wanna compare the two objects of day to see which day is after.</p>
  
  <p>But the problem is when I tried to use compareTo to compare the two days, it causes stack Overflow</p>
  
  <p>This is the day class I created, please help to see why I can't use compareTo.</p>
  
  <pre><code>public class Day implements Cloneable,Comparable&lt;Day&gt;{
  
  private int year;
  private int month;
  private int day;
  
  private static final String MonthNames="JanFebMarMayJunJulAugSepOctNovDec";
  //Constructor
  public Day(int y, int m, int d) {
      this.year=y;
      this.month=m;
      this.day=d;     
  }
  
  
   public void set(String sDay) 
  {
      String[] sDayParts = sDay.split("-");
      this.year = Integer.parseInt(sDayParts[2]);
      this.day = Integer.parseInt(sDayParts[0]);
      this.month = MonthNames.indexOf(sDayParts[1])/3+1;
  }
  
  public Day(String sDay)
  {
      set(sDay);
  
  
  }
  
  
  // Return a string for the day like dd MMM yyyy
  public String toString() {
  
      return day+"-"+ MonthNames.substring((month-1)*3,month*3)+ "-"+ year;
  }
  
  
  
  @Override
  public int compareTo(Day another)
  {
  
      return this.compareTo(another);
  }
  </code></pre>