I am trying to save data(coordinates) in a programm and use it later. I use an array for every coordinate and expand it every time I am saving a new coordinate. But then I sometimes get the error "arrayoutofboundexception". I also tried to use a .txt file and save the data there. But when I read the information I get the same error.
Now my question is: Does anyone know what this error means and what I might do wrong?
Also I would like to ask what you think is the best way to remember data in a programm. Using .txt (or other) files? Arrays? Maybe some other way I don't know?
It would be great if someone could help me.
Here is the code how I save the coordinates and how I use them later:
float[] posX = new float[1]; // reminds the x- coordinates
float[] posY = new float[1]; // reminds the y- coordinates
float[] posZ = new float[1]; // reminds the z- coordinates