I have researched this question for ages and cannot get it right!
I have a populated hashmap and an identically formatted hashmap (Map<Integer, ArrayList<String>>) that I have been working on (it has key value/s equal to other keys in the populated hashmap such as 0,1,2 etc). When I use the .put command to update the populated hashmap the few/one I have been working on replaces everything in the populated hashmap – is this normal? Where am I going wrong? I was expecting it to simply replace the key in question + values….
Excuse the not supplying code but it would mean posting quite an amount to demonstrate, just wondering if anyone could help explain where this might be going wrong. I could throw something together to show if needed…
Much obliged!
This is how a code example might look like:
Testing:
I would say: as expected.