Given the following code:
int x=0;
int y=0;
ArrayList<Point> casilla = new ArrayList<>();
Point punto = new Point(x, y);
//Plantilla
for(int n=0; n<20; n++){
for(int m=0; m<20; m++) {
punto.set(x,y);
casilla.add(punto);
x = x + 1;
Log.d("Casilla:", punto + "");
}
x = 0;
y = y + 1;
}
for (int i=0;i<200;i++){
punto = casilla.get(i);
Log.d("Casilla:", punto + "");
}
When I try to recover the data the array is only filled with the last value of the loop. Can not store values in a nested loop?