java集合中元素的排序有关问题

java集合中元素的排序问题
Student对象包括ID和name,对ArraysList(studentList)中所有Student对象进行排序时
Collections.sort(studentList);这个默认的排序是怎样的
Collections.sort(studentList, new StudentComparator());这是对studentList中的对象按姓名排序,
这句代码里的new StudentComparator()是什么意思?
若要按ID排序怎么写?
------解决思路----------------------
应该重写了Comparator接口
------解决思路----------------------
Collections.sort(studentList); //会调用studentList的元素Student的equals方法来进行比较排序
Collections.sort(studentList, new StudentComparator());//你需要自己实现比较student对象的比较器,重写里面比较两元素大小的方法