I am just curious background of some classes and methods in .NET so i just wonder how ReferenceEquals method can understand 2 references belongs to same object or not?
Share
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.
Because ‘the same object’ means ‘same place in memory’ and the operation can simply check the ‘address’ value of a reference.
Not that you can easily get at that value, but then you never need to.