标签:string new main print logs ons static ati stat
Collections.reverse(arrayList);
下面看例子:
import java.util.ArrayList;import java.util.Collections; public class Main { public static void main(String[] args) { ArrayList arrayList = new ArrayList(); arrayList.add("A"); arrayList.add("B"); arrayList.add("C"); arrayList.add("D"); arrayList.add("E"); System.out.println("反转前排序: " + arrayList); Collections.reverse(arrayList); System.out.println("反转后排序: " + arrayList); } }
标签:string new main print logs ons static ati stat
原文地址:http://www.cnblogs.com/LoganChen/p/6475581.html