problem with ArrayList in Java
问题 I have issues getting my ArrayList to add properly. When I print the ArrayList after the for loop has finished, the ArrayList is the correct length, but every element is the same (the last Coordinate that was created). Can someone fix (and explain) the code below? public class test { private static ArrayList<Coordinate> mOrigCoords; private static ArrayList<Coordinate> mNewCoords; private static int mListSize; private static int mPixelsX; public static void main(String[] args) { mOrigCoords =