Say that I have a Dictionary of <String,List>, for some algorithm I create an aux variable of type List and assign it withe the value of a determined entry in the Dictionary, If i remove or modify an element of this aux List, will it also do it on the Original Dictionary like it does in Java?
Hi.
I believe so.
If you do variable = dict
it creates another instance of the same variable (sorry for my wording). so if you change a value it changes it in both variables. You would basically need to create the dictionary twice to have a true copy.
Regards.
1 Like
Thanks, I actually wanted a shallow copy, so now i can advance knowing it works like i’m used to.
Hi!
How then I can create a deep copy of an object?
When I pass “myObject.Clone” to the right of assignment action - it crashes with the exception(