public class ArrayDemo {
public static void main(String[] args) {
ArrayList<String> list=new ArrayList<String>();
list.add("我");
list.add("爱");
list.add("黑");
list.add("马");
show(list);
System.out.println(list);
}
public static void show(ArrayList<String> list){
Collections.reverse(list);
}
} |