reg Object data type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QVZM?=

    reg Object data type

    Hi,
    I've need clariifcation regarding the Obejct data type.
    Is this object a value type or reference type?....
    can you please some articles which give explaination as to why
    it's treated as value type\reference type???

    Thanks
  • kodehoved

    #2
    Re: reg Object data type

    On May 28, 7:10 am, AVL <A...@discussio ns.microsoft.co mwrote:
    Hi,
    I've need clariifcation regarding the Obejct data type.
    Is this object a value type or reference type?....
    can you please some articles which give explaination as to why
    it's treated as value type\reference type???
    >
    Thanks
    Object is a reference type as stated in the language specification
    (http://www.google.dk/url?sa=t&ct=res...url=http%3A%2F
    %2Fdownload.mic rosoft.com%2Fdo wnload%2F3%2F8% 2F8%2F388e7205-bc10-4226-
    b2a8-75351c669b09%2F CSharp%2520Lang uage
    %2520Specificat ion.doc&ei=I_Q8 SKjhJ5CE1wassu3 QDQ&usg=AFQjCNH 48AGfZpjFXXCFdv GQ1yt9Mk_-
    Iw&sig2=jAv7u0r D6lhN2g2JddAliA ).

    Brian

    Comment

    • Ashutosh

      #3
      Re: reg Object data type

      Object is an reference type. It's the base class for all the reference
      types. The reason why its a reference type is that Microsoft thought
      that way :)

      AVL wrote:
      Hi,
      I've need clariifcation regarding the Obejct data type.
      Is this object a value type or reference type?....
      can you please some articles which give explaination as to why
      it's treated as value type\reference type???
      >
      Thanks

      Comment

      • Alberto Poblacion

        #4
        Re: reg Object data type

        "AVL" <AVL@discussion s.microsoft.com wrote in message
        news:2F831D9F-8BB0-459C-9853-A2BFA4D77773@mi crosoft.com...
        I've need clariifcation regarding the Obejct data type.
        Is this object a value type or reference type?....
        can you please some articles which give explaination as to why
        it's treated as value type\reference type???
        Object is a Reference type. When you assign a Value type to an Object it
        suffers an operation that is called "boxing", where the value is moved into
        a "box" that is assigned a reference. The opposite operation is "unboxing".
        You will find plenty of information if you do a search for "boxing" and
        "unboxing".

        Comment

        • Peter Duniho

          #5
          Re: reg Object data type

          On Tue, 27 May 2008 22:59:44 -0700, Ashutosh <smbs-msdn@nospam.nos pam>
          wrote:
          Object is an reference type. It's the base class for all the reference
          types.
          It's also the base class for all the value types. It's funny like that.
          :)

          But yes, it's a reference type.

          Comment

          Working...