You can read more about the ArrayList container on the link below:
Processing.org/reference/ArrayList.html
Alternatively you can keep using a vanilla array and call Processing’s shorten() to remove its tail index:
Processing.org/reference/shorten_.html