I have no idea about Java...
See the comments in the code marked with 'HERE X.) <<<<< '
import java.util.ArrayList;
public class ArrayListDemo {
public static void main(String[] args)
{
ArrayList<Integer> arrayList = new ArrayList<Integer>();
for (int i = 1; i<5 ; i++)
arrayList.add(i);
System.out.println(arrayList);
arrayList.remove(3);
System.out.println(arrayList);
for (int i = 0; i<arrayList.size(); i++) {
System.out.print(arrayList.get(i)+ " ");
}
}
}