1 List<String> stringList = Arrays.asList("A", "B", "C");
2 Collections.reverse(stringList);
3 assertThat(stringList).containsExactly("C", "B", "A");
1//import java.util.Collections;
2//create and add items to list
3Collectons.reverse(list);
1public static void main(String[] args) {
2
3 ArrayList<Integer>list = new ArrayList<>();
4 for(int i = 1; i < 6; i++){ // bu element index degil.
5 list.add(i);
6 }
7 System.out.println(list); // [1, 2, 3, 4, 5]
8
9 for (int i = list.size()-1; i >= 0; i--) {
10 int each = list.get(i); // unboxing
11 System.out.print(each + " "); // 5 4 3 2 1
12 }