package cn.edu.ahtcm.bean;
import java.util.*;
public class TestCollectionSort{
public List getListData(){
List list = new ArrayList();
list.add("China");
list.add("Usa");
list.add("India");
list.add("Japan");
return list;
}
public static void main(String[] args){
List list = new TestCollectionSort().getListData();
System.out.println("默认排序前:");
System.out.println(list);
Collections.sort(list);
System.out.println("默认排序后:");
System.out.println(list);
ArrayList<String> list1 = new ArrayList<>();
list1.add("China");
list1.add("Usa");
list1.add("india");
list1.add("Japan");
System.out.println("默认排序前:");
System.out.println(list1);
Collections.sort(list1);
System.out.println("默认排序后:");
System.out.println(list1);
}
}