import java.util.ArrayList;
import java.util.Collections;
public class ListSort {
public static void main(String[] args) {
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(new Integer(5));
list.add(new Integer(3));
list.add(new Integer(2));
list.add(new Integer(4));
list.add(new Integer(1));
System.out.println("没有排序的时候:"+list);
Collections.sort(list);
System.out.println("Collections.sort(list)=" + list );
Collections.reverse(list);
System.out.println("Collections.reverse(list)=" + list );
}
}