Hi,
one reason is because you are referencing the same objects from Map 1 and Map 2?
Map m1 = new HashMap();
m1.put( 搆ey? new Point() );
Point p = (Point) m1.get(搆ey?;
p.setX( 100 );
Map m2 = new HashMap();
m2.put( 搆ey? p );// Same Point in another map
println( m1.get(搆ey? ); // [100,0]
There is only one Point which is referenced from both maps.
Best wishes,
Christian Ullenboom | http://www.tutego.com/
> > Post some (formatted) code. But I reckon it's
> because
> > you don't realise that an object can be
> referenced
> > in more than one HashMap at once
>
> Or worse, hashMap1 and hashMap2 both refer to the
> same HashMap object?
More likely actually, yeh. Irrelevant now though, the bloody aliens have taken another developer, never to be seen again
> More likely actually, yeh. Irrelevant now though, the
> bloody aliens have taken another developer, never
> to be seen again
Thank you for your comment.
Uzair seems to be posting approximately once a year, so maybe the aliens will bring him or her back next year? Impossible to say whether he or she will still have the same problem by then.
;-) ;-)