ArrayList question
in
Programming Questions
•
8 months ago
- ArrayList history = new ArrayList();
- PVector d = new PVector();
- d.x=100;
- d.y=100;
- d.z=0;
- history.add(d);
- d.x=200;
- d.y=200;
- d.z=0;
- history.add(d);
- println(history);
Why the result is [[ 200.0, 200.0, 0.0 ], [ 200.0, 200.0, 0.0 ]]
and NOT [[ 100.0, 100.0, 0.0 ], [ 200.0, 200.0, 0.0 ]]
1