This discussion is archived
8 Replies Latest reply: Mar 18, 2012 7:46 PM by 858257 RSS

Create Immutable HashMap

858257 Newbie
Currently Being Moderated
Hello - I have a situation where in I need to send a hashmap as an argument to another method. And I do not have any control over this other method and I have to make sure that the HashMap I am passing should not be updated.

I could have used Collections.unModifiableMap() to a get an unmodifiableMap but, the I need to specifically pass HashMap and not just any Map.

Please let me know how to achieve this.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points