分类方法三出错
public void testSort3()
{
List<String> studentList=new ArrayList<String>();
studentList.add(new Student(1 +"","小明"));//出错
studentList.add(new Student(2 +"","小红"));//出错
studentList.add(new Student(3 +"","小兰"));//出错
System.out.println("排序前");
for (String string : studentList) {
System.out.println("学生"+student.name);
}
Collections.sort(studentList);
}
报错了。。老师说的报错的没出错,