object and Object

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

    object and Object

    Hi all,

    I am just starting to write some code in C#. One time I accidently used
    "object" instead of "Object". The program didn't complain at all and worked
    fine.

    I am just wondering is there any difference between object and Object in C#?

    thanks
    --
    Betty
  • Jeff Johnson

    #2
    Re: object and Object

    "c676228" <betty@newsgrou p.nospamwrote in message
    news:0E3556F9-7349-4A2F-96E8-7F750B472C39@mi crosoft.com...
    I am just starting to write some code in C#. One time I accidently used
    "object" instead of "Object". The program didn't complain at all and
    worked
    fine.
    >
    I am just wondering is there any difference between object and Object in
    C#?
    Search for a recent thread titled "String or string".


    Comment

    • =?UTF-8?B?IlBhdHJpayBMw7Z3ZW5kYWhsIFtNVlBdIg==?=

      #3
      Re: object and Object

      No there is no difference.

      Object refers to the real name of the type: System.Object and object is
      the language alias for that type.

      --
      Patrik Löwendahl

      [MVP] [MCT - Enterprise Application Development]

      c676228 skrev:
      Hi all,
      >
      I am just starting to write some code in C#. One time I accidently used
      "object" instead of "Object". The program didn't complain at all and worked
      fine.
      >
      I am just wondering is there any difference between object and Object in C#?
      >
      thanks

      Comment

      • =?Utf-8?B?YzY3NjIyOA==?=

        #4
        Re: object and Object

        Thank you both Patrick and Jeff.

        Somehow I got an impression from somewhere before(Maybe another programming
        language?) that String represent an object data type and string just
        represent basic data type. That's why I cannot figure out the difference
        between object and Object and I never knew it is an alias in C#.
        --
        Betty


        ""Patrik Löwendahl [MVP]"" wrote:
        No there is no difference.
        >
        Object refers to the real name of the type: System.Object and object is
        the language alias for that type.
        >
        --
        Patrik Löwendahl

        [MVP] [MCT - Enterprise Application Development]
        >
        c676228 skrev:
        Hi all,

        I am just starting to write some code in C#. One time I accidently used
        "object" instead of "Object". The program didn't complain at all and worked
        fine.

        I am just wondering is there any difference between object and Object in C#?

        thanks
        >

        Comment

        • =?UTF-8?B?IlBhdHJpayBMw7Z3ZW5kYWhsIFtNVlBdIg==?=

          #5
          Re: object and Object

          There is no "primitive" types in C#, all the type keywords in the
          language is mapped to a System.XXXX type, for some it's valuetypes like
          int, datetime etc, and for others like string it's a reference type,
          what most people call an object.

          --
          Patrik Löwendahl

          [MVP] [MCT - Enterprise Application Development]

          c676228 skrev:
          Thank you both Patrick and Jeff.
          >
          Somehow I got an impression from somewhere before(Maybe another programming
          language?) that String represent an object data type and string just
          represent basic data type. That's why I cannot figure out the difference
          between object and Object and I never knew it is an alias in C#.

          Comment

          • =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=

            #6
            Re: object and Object

            c676228 wrote:
            Thank you both Patrick and Jeff.
            >
            Somehow I got an impression from somewhere before(Maybe another programming
            language?) that String represent an object data type and string just
            represent basic data type. That's why I cannot figure out the difference
            between object and Object and I never knew it is an alias in C#.
            That would be Java. There is no such duplicate data types in C#, instead
            it uses boxing whenever a value type needs to be stored as a reference type.

            --
            Göran Andersson
            _____
            Göran Anderssons privata hemsida.

            Comment

            • =?UTF-8?B?QXJuZSBWYWpow7hq?=

              #7
              Re: object and Object

              Göran Andersson wrote:
              c676228 wrote:
              >Somehow I got an impression from somewhere before(Maybe another
              >programming language?) that String represent an object data type and
              >string just represent basic data type. That's why I cannot figure out
              >the difference between object and Object and I never knew it is an
              >alias in C#.
              >
              That would be Java. There is no such duplicate data types in C#, instead
              it uses boxing whenever a value type needs to be stored as a reference
              type.
              Java does not have simple data types for neither Object nor String.

              Arne

              Comment

              • Steven Cheng

                #8
                Re: object and Object

                Hi Betty,

                As for the following things you mentioned ,I think that might be specific
                to some other programming language rather than .NET/C#.

                ===============
                Somehow I got an impression from somewhere before(Maybe another programming
                language?) that String represent an object data type and string just
                represent basic data type.
                ==============

                For .NET framework, all the core FCL is shared in all programming
                languages. And for the Object class, the standard .NET class name is
                System.Object, and in C#, the language provide the equivalent alias
                "object". They are the same. But if you use "System.Obj ect" style, that
                will be easier for you to share the type name from other languages.

                Sincerely,

                Steven Cheng

                Microsoft MSDN Online Support Lead


                Delighting our customers is our #1 priority. We welcome your comments and
                suggestions about how we can improve the support we provide to you. Please
                feel free to let my manager know what you think of the level of service
                provided. You can send feedback directly to my manager at:
                msdnmg@microsof t.com.

                =============== =============== =============== =====
                Get notification to my posts through email? Please refer to
                http://msdn.microsoft.com/en-us/subs...#notifications.

                Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
                where an initial response from the community or a Microsoft Support
                Engineer within 1 business day is acceptable. Please note that each follow
                up response may take approximately 2 business days as the support
                professional working with you may need further investigation to reach the
                most efficient resolution. The offering is not appropriate for situations
                that require urgent, real-time or phone-based interactions or complex
                project analysis and dump analysis issues. Issues of this nature are best
                handled working with a dedicated Microsoft Support Engineer by contacting
                Microsoft Customer Support Services (CSS) at
                http://support.microsoft.com/select/...tance&ln=en-us.
                =============== =============== =============== =====
                This posting is provided "AS IS" with no warranties, and confers no rights.


                --------------------
                >Subject: Re: object and Object
                >Date: Fri, 17 Oct 2008 11:57:01 -0700
                >
                >Thank you both Patrick and Jeff.
                >
                >Somehow I got an impression from somewhere before(Maybe another
                programming
                >language?) that String represent an object data type and string just
                >represent basic data type. That's why I cannot figure out the difference
                >between object and Object and I never knew it is an alias in C#.
                >--
                >Betty
                >
                >
                >""Patrik Löwendahl [MVP]"" wrote:
                >
                >No there is no difference.
                >>
                >Object refers to the real name of the type: System.Object and object is
                >the language alias for that type.
                >>
                >--
                >Patrik Löwendahl
                >http://www.lowendahl.net
                >[MVP] [MCT - Enterprise Application Development]
                >>
                >c676228 skrev:
                Hi all,
                >
                I am just starting to write some code in C#. One time I accidently
                used
                "object" instead of "Object". The program didn't complain at all and
                worked
                fine.
                >
                I am just wondering is there any difference between object and Object
                in C#?
                >
                thanks
                >>
                >

                Comment

                • Steven Cheng

                  #9
                  Re: object and Object

                  Hi Betty,

                  Do you still have any questions on this?

                  Sincerely,

                  Steven Cheng

                  Microsoft MSDN Online Support Lead


                  Delighting our customers is our #1 priority. We welcome your comments and
                  suggestions about how we can improve the support we provide to you. Please
                  feel free to let my manager know what you think of the level of service
                  provided. You can send feedback directly to my manager at:
                  msdnmg@microsof t.com.
                  --------------------
                  >From: =?Utf-8?B?YzY3NjIyOA= =?= <betty@newsgrou p.nospam>
                  >References: <0E3556F9-7349-4A2F-96E8-7F750B472C39@mi crosoft.com>
                  <e#DqbFIMJHA.27 60@TK2MSFTNGP06 .phx.gbl>
                  >Subject: Re: object and Object
                  >Date: Fri, 17 Oct 2008 11:57:01 -0700
                  >
                  >Thank you both Patrick and Jeff.
                  >
                  >Somehow I got an impression from somewhere before(Maybe another
                  programming
                  >language?) that String represent an object data type and string just
                  >represent basic data type. That's why I cannot figure out the difference
                  >between object and Object and I never knew it is an alias in C#.
                  >--
                  >Betty
                  >
                  >
                  >""Patrik Löwendahl [MVP]"" wrote:
                  >
                  >No there is no difference.
                  >>
                  >Object refers to the real name of the type: System.Object and object is
                  >the language alias for that type.
                  >>
                  >--
                  >Patrik Löwendahl
                  >http://www.lowendahl.net
                  >[MVP] [MCT - Enterprise Application Development]
                  >>
                  >c676228 skrev:
                  Hi all,
                  >
                  I am just starting to write some code in C#. One time I accidently
                  used
                  "object" instead of "Object". The program didn't complain at all and
                  worked
                  fine.
                  >
                  I am just wondering is there any difference between object and Object
                  in C#?
                  >
                  thanks
                  >>
                  >

                  Comment

                  • =?Utf-8?B?YzY3NjIyOA==?=

                    #10
                    Re: object and Object

                    thank you all. I got it.
                    Betty
                    --
                    Betty


                    ""Steven Cheng"" wrote:
                    Hi Betty,
                    >
                    As for the following things you mentioned ,I think that might be specific
                    to some other programming language rather than .NET/C#.
                    >
                    ===============
                    Somehow I got an impression from somewhere before(Maybe another programming
                    language?) that String represent an object data type and string just
                    represent basic data type.
                    ==============
                    >
                    For .NET framework, all the core FCL is shared in all programming
                    languages. And for the Object class, the standard .NET class name is
                    System.Object, and in C#, the language provide the equivalent alias
                    "object". They are the same. But if you use "System.Obj ect" style, that
                    will be easier for you to share the type name from other languages.
                    >
                    Sincerely,
                    >
                    Steven Cheng
                    >
                    Microsoft MSDN Online Support Lead
                    >
                    >
                    Delighting our customers is our #1 priority. We welcome your comments and
                    suggestions about how we can improve the support we provide to you. Please
                    feel free to let my manager know what you think of the level of service
                    provided. You can send feedback directly to my manager at:
                    msdnmg@microsof t.com.
                    >
                    =============== =============== =============== =====
                    Get notification to my posts through email? Please refer to
                    http://msdn.microsoft.com/en-us/subs...#notifications.
                    >
                    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
                    where an initial response from the community or a Microsoft Support
                    Engineer within 1 business day is acceptable. Please note that each follow
                    up response may take approximately 2 business days as the support
                    professional working with you may need further investigation to reach the
                    most efficient resolution. The offering is not appropriate for situations
                    that require urgent, real-time or phone-based interactions or complex
                    project analysis and dump analysis issues. Issues of this nature are best
                    handled working with a dedicated Microsoft Support Engineer by contacting
                    Microsoft Customer Support Services (CSS) at
                    http://support.microsoft.com/select/...tance&ln=en-us.
                    =============== =============== =============== =====
                    This posting is provided "AS IS" with no warranties, and confers no rights.
                    >
                    >
                    --------------------
                    Subject: Re: object and Object
                    Date: Fri, 17 Oct 2008 11:57:01 -0700
                    >

                    Thank you both Patrick and Jeff.

                    Somehow I got an impression from somewhere before(Maybe another
                    programming
                    language?) that String represent an object data type and string just
                    represent basic data type. That's why I cannot figure out the difference
                    between object and Object and I never knew it is an alias in C#.
                    --
                    Betty


                    ""Patrik Löwendahl [MVP]"" wrote:
                    No there is no difference.
                    >
                    Object refers to the real name of the type: System.Object and object is
                    the language alias for that type.
                    >
                    --
                    Patrik Löwendahl

                    [MVP] [MCT - Enterprise Application Development]
                    >
                    c676228 skrev:
                    Hi all,

                    I am just starting to write some code in C#. One time I accidently
                    used
                    "object" instead of "Object". The program didn't complain at all and
                    worked
                    fine.

                    I am just wondering is there any difference between object and Object
                    in C#?

                    thanks
                    >
                    >
                    >

                    Comment

                    Working...