Difference between object and Object

  • Thread starter Thread starter Phil Johnson
  • Start date Start date
P

Phil Johnson

Hi,

I'm aware of the differences between string and String, but wondered what
the differences were 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 :-)
 
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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top