如果我从我的 HashMap 中拉出一个对象,然后对其进行修改。它也会在 HashMap 内部进行修改吗?或者,修改后是否需要重新设置回HashMap?
例如:
HashMap<Integer,TwoPoints> loc = new HashMap<Integer,TwoPoints>();
...
...
TwoPoints tp = loc.get(Id); //pulls out the object
tp.setPoint(group, new Point(x,y); //a method to set something inside the object I pulled.