标签:class blog code java http ext
借助Collections工具类:
import java.util.ArrayList; import java.util.Collections; public class TTEST { public static void main(String[] args) { ArrayList<String> arr = new ArrayList<String>(); for(int i=0;i<10;++i){ arr.add("str"+i); } for (String string : arr) { System.out.print(string+" "); } System.out.println(); Collections.reverse(arr); for (String string : arr) { System.out.print(string+" "); } } }
标签:class blog code java http ext
原文地址:http://blog.csdn.net/howlaa/article/details/34809737