import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args) {
ArrayList arrayList = new ArrayList();
arrayList.add("A");
arrayList.add("B");
arrayList.add("C");
arrayList.add("D");
arrayList.add("E");
System.out.println(arrayList);
Collections.swap(arrayList, 0, 4);
System.out.println(arrayList);
}
}
/*
[A, B, C, D, E]
[E, B, C, D, A]
*/