Difference between object and Object

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

    #1

    Difference between object and Object

    Hi,

    I'm aware of the differences between string and String, but wondered what
    the differences were between object and Object?
    --
    Regards,

    Phillip Johnson (MCPD Enterprise Developer)

  • Peter Morris

    #2
    Re: Difference between object and Object

    I'm aware of the differences between string and String, but wondered what
    the differences were between object and Object?
    Exactly the same as the differences between string and String :-)

    Comment

    • Marc Gravell

      #3
      Re: Difference between object and Object

      There are no differences between object and Object, nor string and
      String - *except* that you don't need "using System" with string/object.
      "object" and "string" are simply aliases for System.Object and
      System.String.

      (There might be other resolution foibles if you have a local class named
      String, where "string" would refer to the .NET string, not your local type).

      Marc

      Comment

      • =?Utf-8?B?UGhpbCBKb2huc29u?=

        #4
        Re: Difference between object and Object

        My understanding was that string with a lower case s was a primitive type
        (stored on the stack etc and not an object) and that string with a capital S
        was an object and stored on the heap.

        I might be wrong on that though.

        --
        Regards,

        Phillip Johnson (MCPD Enterprise Application Developer)



        "Marc Gravell" wrote:
        There are no differences between object and Object, nor string and
        String - *except* that you don't need "using System" with string/object.
        "object" and "string" are simply aliases for System.Object and
        System.String.
        >
        (There might be other resolution foibles if you have a local class named
        String, where "string" would refer to the .NET string, not your local type).
        >
        Marc
        >

        Comment

        • Marc Gravell

          #5
          Re: Difference between object and Object

          In .NET, there is no string/String debate. They are *exactly* the same
          thing; every .NET string(==String ) is a reference-type, stored on the heap.

          Marc

          Comment

          • =?Utf-8?B?UGhpbCBKb2huc29u?=

            #6
            Re: Difference between object and Object

            I'm happy with that :-)

            Thanks for the info.
            --
            Regards,

            Phillip Johnson


            "Marc Gravell" wrote:
            In .NET, there is no string/String debate. They are *exactly* the same
            thing; every .NET string(==String ) is a reference-type, stored on the heap.
            >
            Marc
            >

            Comment

            Working...