Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deep Copying HashMap

 
V Bose
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I construct a new HashMap from an existing one like


is it a deep copy of the 'original' HashMap.
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The two HashMaps will contain unique maps, but the maps reference the same objects.

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Intermediate forum...
 
farhan java
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so anybody knows the solution how to copy hashmap into another hashmap with the key-value pair, without haveing same refernce.

please reply urgently.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic