Why Multiple References to the Same Object

  • Thread starter Thread starter george r smith
  • Start date Start date
G

george r smith

I understand that when you compare (using ==) objects you are seeing if they
both refer to the same object. My question why or when would you ever use
multiple references to the same object. What would be a production code type
example why you would set objOne = objTwo.

Thanks
grs
 
I understand that when you compare (using ==) objects you are seeing if they
both refer to the same object. My question why or when would you ever use
multiple references to the same object. What would be a production code type
example why you would set objOne = objTwo.

Linked list for one.


bullshark
 
Hi George,

Thanks for posting in this group.
There are many situations that need multi-reference point to the same
object.
Except the link list only one item(head and tail reference point to this
item) as bullshark said, databinding need multi control refer to the same
data source, so there will be many reference point to the same record.
Also, when you pass an object to a method by reference, there will be
another reference in this method point to this object.

If you still have any unclear, please feel free to let me know

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "george r smith" <[email protected]>
| Subject: Why Multiple References to the Same Object
| Date: Thu, 6 Nov 2003 11:10:28 -0600
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 216-63-152-112.budgetext.com 216.63.152.112
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:197252
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I understand that when you compare (using ==) objects you are seeing if
they
| both refer to the same object. My question why or when would you ever use
| multiple references to the same object. What would be a production code
type
| example why you would set objOne = objTwo.
|
| Thanks
| grs
|
|
|
 
Back
Top