用collection.sort()方法对list集合排序
第一种是list中的对象实现Comparable接口,如下:
第二种方法是根据Collections.sort重载方法来实现,例如:
点此查看原文