Article View: borland.public.csharpbuilder.language.csharp
Article #518Re: about equal
From: David Clegg
Date: Fri, 12 Nov 2004 01:37
Date: Fri, 12 Nov 2004 01:37
35 lines
2207 bytes
2207 bytes
lobster wrote: > hi,all, what's the difference between > equals, referenceequals,==? Object.Equals will tell you whether to object instances should be considered equal. This may be done by comparing whether the object references point to the same instance, but it may also be done by seeing whether two different references have equivilant state or values. The default implementation in System.Object simply compares if the references are pointing to the same object. Object.ReferenceEquals checks whether the two references point to the same object. The == operator by default operates like Object.ReferenceEquals, but be warned that this can be overloaded to provide different behaviour. As a result it is recommended to use Object.ReferencesEquals if you wish to check whether two references point to the same object. HTH. -- Cheers, David Clegg dclegg@gmail.com Vote 1 http://cc.borland.com/codecentral/ccweb.exe/listing?id=21489 :-) Now supports Google Groups searching with Dyna-extend(tm) technology! QualityCentral. The best way to bug Borland about bugs. http://qc.borland.com "This donut has purple in the middle. Purple is a fruit!" - Homer Simpson
Technical Details
Message-ID:
<xn0dpoehnb71nr005@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41941ac9@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,4ce6d5ccdf90d708
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "David Clegg" <dclegg@gmail.com>
Subject: Re: about equal
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <41941ac9@newsgroups.borland.com>
Organization: eBet Limited
User-Agent: XanaNews/1.16.4.6
X-Face: d0!4zUWIBj<CO5m0`=Vu"m.2)(~|1-4:I]5n5<OE<hv+kK)Z:n<h&MnW9t_{}>cw&gbV#f>
mHS4h1mcw[cz:R#J,T;)w/($:2Vl5CQnFP(c\wmN0rSvn25.kmVpCmqb]gj7l9ZP+O4+a+P~L#]4s"
"Tx^zQ/N"#'/?lV?SHpdR\5(iNj.,I_YMfF=/_3.JWAs3
Message-ID: <xn0dpoehnb71nr005@newsgroups.borland.com>
X-Ref: newsgroups.borland.com ~XNS:00000888
NNTP-Posting-Host: 203.35.87.58
Date: 11 Nov 2004 18:37:32 -0700
X-Trace: newsgroups.borland.com 1100227052 203.35.87.58 (11 Nov 2004 18:37:32 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail