I had a minor change in the system maintenance, but I had an unexpected mistake, very confused,
The original program example is as follows:
for (int i =0;i<resultlist.size (); i++) {Map resultmap = new HashMap (); resultmap = (MAP) resultlist.get (i); resultgetlis T.add (RESULTMAP); } System.out.println ("resultgetlist =" +resutlgetlist);
In order to improve the efficiency of the program I think that the second line should not be put into the loop inside, because put it in the loop every time the new object, affect the speed, so I improve after the following:
Map Resultmap = new HashMap ();
for (int i =0;i<resultlist.size (); i++) {Resultmap = (MAP) resultlist.get (i); Resultgetlist.add (Resultmap);} System.out.println ("resultgetlist =" +resutlgetlist); But the modified result is different from the expected result, but I do not know where the problem, looking for a long time also did not find out, modify the program after the output List is always the last map value of the repeat, this let me very confused, I guess, List.add, is added to the object, or is the address of memory, The value of the map is not saved.