1ArrayList<Integer> arrlist = new ArrayList<Integer>();
2//This is how to reverse arrlist's oringinal order.
3Collections.reverse(arrlist);
4
5//This is how to sort in a reverse order
6 Collections.sort(arrlist, Collections.reverseOrder());
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 }