如果我從我的HashMap中取出一個對象,然後修改它。它會在HashMap內部修改嗎?或者,我需要在修改它之後再次將它設置回HashMap嗎?關於HashMap.get(key)函數
例如:
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.
試試吧,看看.... – duffymo