Problems with Arrays

My teacher helped me and gave me the solution. Now I do not need arrays.
The solution is here:
https://discourse.processing.org/t/how-can-i-make-multiple-objects-of-the-same-class-to-execute-the-same-method-at-the-same-time/26654/10