java List ArrayList倒序
用Collections.reverse(mylist)即可。如:
List mylist = new ArrayList();
mylist.add("a");
mylist.add("b");
mylist.add("c");
Collections.reverse(mylist);
for (String string : mylist) {
System.out.println(string);
}
用Collections.reverse(mylist)即可。如: List mylist = new ArrayList(); mylist.add("a"); mylist.add("b"); mylist.add("c"); Collections.reverse(mylist); for (String string : mylist) { System.out.println(string); }