Error Message: The method sort(List<T>) in the type Collections is not applicable for the arguments (ArrayList<Date>)
<p>Keep getting error message, but don't know why. Can't get code to sort the list using Collections.sort()</p>

<p>Here is what I have. 3 java files.</p>

<p>The Interface file.</p>

<pre><code>public interface Comparable&lt;T&gt; {
   public int compareTo(T other);
}
</code></pre>

<p>The Class file.</p>

<pre><code>public class Date implements Comparable&lt;Date&gt;{

private int year;
private int month;
private int day;

public Date(int month, int day, int year){   
   this.month = month;
   this.day = day;
   this.year = year;
}

public int getYear(){
   return this.year;
}

public int getMonth(){
   return this.month;
}

public int getDay(){
   return this.day;
}
public String toString(){
   return month + "/" + day + "/" + year;
}


public int compareTo(Date other){
    if (this.year!=other.year){
        return this.year-other.year;
    } else if (this.month != other.month){
        return this.month-other.month;
    } else {
        return this.day-other.day;
    }
}
</code></pre>

<p>}</p>

<p>The Client class</p>

<pre><code>import java.util.*;

public class DateTest{
   public static void main(String[] args){

  ArrayList&lt;Date&gt; dates = new ArrayList&lt;Date&gt;();
  dates.add(new Date(4, 13, 1743)); //Jefferson
  dates.add(new Date(2, 22, 1732)); //Washington
  dates.add(new Date(3, 16, 1751)); //Madison
  dates.add(new Date(10, 30, 1735)); //Adams
  dates.add(new Date(4, 28, 1758)); //Monroe     


  System.out.println(dates);
  Collections.sort(dates);
  System.out.println("birthdays = "+dates);

}




}
</code></pre>

<p>The error message I get is "The method sort(List) in the type Collections is not applicable for the arguments   (ArrayList)"</p>