By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,578 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

object and Object

P: n/a
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
Oct 17 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"c676228" <be***@newsgroup.nospamwrote in message
news:0E**********************************@microsof t.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".
Oct 17 '08 #2

P: n/a
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
Oct 17 '08 #3

P: n/a
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
Oct 17 '08 #4

P: n/a
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:
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#.
Oct 17 '08 #5

P: n/a
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
_____
http://www.guffa.com
Oct 18 '08 #6

P: n/a
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
Oct 18 '08 #7

P: n/a
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:
ms****@microsoft.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
Oct 20 '08 #8

P: n/a
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:
ms****@microsoft.com.
--------------------
>From: =?Utf-8?B?YzY3NjIyOA==?= <be***@newsgroup.nospam>
References: <0E**********************************@microsoft.co m>
<e#**************@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
Oct 22 '08 #9

P: n/a
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.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:
ms****@microsoft.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

Oct 27 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.