object and Object

  • Thread starter Thread starter c676228
  • Start date Start date
C

c676228

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
 
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".
 
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:
 
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]" said:
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
 
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
http://www.lowendahl.net
[MVP] [MCT - Enterprise Application Development]

c676228 skrev:
 
c676228 said:
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 said:
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
 
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.Object" 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:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#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/default.aspx?target=assistance&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]" said:
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
 
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:
(e-mail address removed).
--------------------
From: =?Utf-8?B?YzY3NjIyOA==?= <[email protected]>
References: <[email protected]>
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]" said:
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
 
thank you all. I got it.
Betty
--
Betty


"Steven Cheng" said:
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.Object" 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:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#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/default.aspx?target=assistance&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]" said:
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
 
I am all set for this. Thank you so much.
--
Betty


"Steven Cheng" said:
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:
(e-mail address removed).
--------------------
From: =?Utf-8?B?YzY3NjIyOA==?= <[email protected]>
References: <[email protected]>
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]" said:
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
 
Back
Top