I have
SomeClass sc1 = new SomeClass();
SomeClass sc2 = sc1;
Will sc2 change due to sc1(when sc1 is changed) ?
If not, how to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes any changes to
sc1will be reflected insc2as both of the point to the same object.So to say if this is the structure of
SomeClassif you do this
But if you do this: