How to store random coordinates?

You can store 3 coordiantes in the PVector class. It is in the format new PVector(x,y,z).

To access it use:

float x = 123, y = 321, z = -333;
PVector pos = new PVector(x,y,z);
//instead of sphere(x,y,z) use sphere(pos.x,pos.y,pos.z);
//or in ArrayList form
ArrayList<PVector> list = new ArrayList<PVector>();
list.add(new PVector(x,y,z));
square(list.get(i).x,list.get(i).y,sphere.get(i).z);

In the PVector class, you can essentially store 3 float values.