ReferenceEquals如何理解引用属于同一对象? [英] How ReferenceEquals can understand references belong same object?
本文介绍了ReferenceEquals如何理解引用属于同一对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是对.NET中某些类和方法的好奇,所以我只是想知道ReferenceEquals方法如何理解2个引用是否属于同一对象?
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?
推荐答案
因为相同的对象"表示内存中的相同位置",并且该操作可以简单地检查引用的地址"值.
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.
这篇关于ReferenceEquals如何理解引用属于同一对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文