Okay, I know this question has been asked before: Previous Question
I have also looked into a few other threads and websites and they all seem to create more questions than answers.
Josh Bloch on Design - an article discussing .clone();
But I still couldn't work out the answer to my problem.
When I clone my 2D array:
values = Map.mapValues.clone();
I still cannot safely modify the content of values
as it still modifies the content of Map.mapValues
.
Is there actually a way to copy an array which is more efficient than me just re-creating one from scratch each time?
Thanks