用Collections.reverse(list)即可。如:
List<String> list = Arrays.asList(new String[] {"aa", "bb", "cc", "dd", "ee"});
Collections.reverse(list);
for (String string : list) {
System.out.println(string);
}
java ArrayList倒序
最新推荐文章于 2023-07-07 16:02:22 发布
用Collections.reverse(list)即可。如:
List<String> list = Arrays.asList(new String[] {"aa", "bb", "cc", "dd", "ee"});
Collections.reverse(list);
for (String string : list) {
System.out.println(string);
}