本帖最后由 u010557116 于 2013-05-22 17:37:45 编辑

解决方案 »

  1.   

    报错是否因为 Student 类的问题?
      

  2.   


    class Student implements Comparable<Student>//实现接口
    {
    public int age;
    public Student()
    {

    }
    public Student(int age)
    {
    this.age = age;
    } public int compareTo(Student other)//重写方法
    {
    return this.age - other.age;
    } public String toString() {
    return "age=" + age ;
    }

    }