object assignment

Posted by sandhya on Stack Overflow See other posts from Stack Overflow or by sandhya
Published on 2010-03-21T07:08:51Z Indexed on 2010/03/21 7:11 UTC
Read the original article Hit count: 305

Filed under:

Hi i have a scenario like

      myclass obj1 = new myclass();
      ............//some operations on obj1;
      myclass obj2 = new myclass();
      obj2 = obj1;

now, my problem is if i modify any parameter, it is effected in both objects (as both refer to same location). but, when i modify obj2 parameter, it should not parameter value in obj1. (means both should not point to same location). how can i do that? please help me

© Stack Overflow or respective owner

Related posts about c#