Why Multiple References to the Same Object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • george r smith

    Why Multiple References to the Same Object

    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


  • bullshark

    #2
    Re: Why Multiple References to the Same Object

    On Thu, 6 Nov 2003 11:10:28 -0600, "george r smith" <gsmith@budgete xt.com> wrote:
    [color=blue]
    >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.[/color]

    Linked list for one.


    bullshark


    Comment

    • Jeffrey Tan[MSFT]

      #3
      RE: Why Multiple References to the Same Object


      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" <gsmith@budgete xt.com>
      | 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: <um9phjIpDHA.25 28@TK2MSFTNGP10 .phx.gbl>
      | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
      | NNTP-Posting-Host: 216-63-152-112.budgetext.c om 216.63.152.112
      | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
      | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1972 52
      | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
      |
      |
      |

      Comment

      Working...