import java.util.ArrayList;
import java.util.Collections;
public class ReverseOrder {
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList arrayList = new ArrayList();
arrayList.add("A");
arrayList.add("B");
arrayList.add("C");
arrayList.add("D");
arrayList.add("E");
System.out.println("Before Reverse Order, ArrayList Contains : " + arrayList);
Collections.reverse(arrayList);
System.out.println("After Reverse Order, ArrayList Contains : " + arrayList);
}
}
Console:Before Reverse Order, ArrayList Contains : [A, B, C, D, E]
After Reverse Order, ArrayList Contains : [E, D, C, B, A]