In C# i have a class called myclass now ,
I’m creating a object like this,
myclass myx = new myclass();
then
myx = new myclass();
It’s not giving any error but what this means …..
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.
It means you are creating yet another instance and assigning it to your variable, effectively “abandoning” the first one you created with new.
The garbage collector will know to clean the old one at some point. You can no longer access it, since you did not save it to another variable.