我有一小部分只是半功能的代码。有人可以向我解释为什么我的ArrayList> ALL_PIXELS为每个位置保持相同的值?
//为什么这不会使每行的ALL_PIXELS唯一.............
for (int i = 0; i < FRAME_HEIGHT; i++) {
HashMap<String, Double> t = boundsHistory.get(zoomNum);
PI task = new PI(i, t);
//this is the problem. some where
ArrayList<Integer> temp = new ArrayList<Integer>();
temp = task.execute();
//System.out.println(temp);
ALL_PIXELS.add(temp);
//System.out.println(ALL_PIXELS.get(i)); //still unique here....WHYYYYYYY
//System.out.println(temp); //this shows that temp is a unique array each row
}// end for loop
//why is all pixels seting the same vales to all of its sub arrays
//System.out.println(ALL_PIXELS.get(3));
//System.out.println(ALL_PIXELS.get(300));
当我在for循环后打印出来时,如何确保ALL_PIXELS数组列表保持唯一,那么任何建议都会很好。