I have a script like:
MyClass obj1 = new MyClass();
............//some operations on obj1;
MyClass obj2 = new MyClass();
obj2 = obj1;
I have the following problem: if I change any parameter, this is affected in both objects (since both belong to the same place) - but when I change the obj2 parameter, it should not change this parameter value in obj1 (i.e. means both must not point to the same place). How can i do this? Please help me. I cannot clone here, since myclass does not implement ICloneable, and I cannot change myclass. if I clone serialization and deserialization, will it be a Deep clone?
source
share