It's better Java style to iterate through an ArrayList using the foreach syntax.
So in https://www.processing.org/reference/ArrayList.html, in the draw() method in the example, instead of
for (int i = balls.size()-1; i >= 0; i--) {
Ball ball = balls.get(i);
you should use
for (Ball ball : balls) {
It's better Java style to iterate through an ArrayList using the foreach syntax.
So in https://www.processing.org/reference/ArrayList.html, in the draw() method in the example, instead of
for (int i = balls.size()-1; i >= 0; i--) {
Ball ball = balls.get(i);
you should use
for (Ball ball : balls) {