I have a hashmap which I want to copy for other use. But whenever I copy it and reuse it, it also changes the original one. Why is that?
do {
This might be coming a bit late, but another simple solution will be to Serialize the map to an output Stream and de-serialize it to a new Map Object. Thats also one of the easiest ways to break the singleton pattern.