41

Possible Duplicate:
c#: difference between “System.Object” and “object”

Hello,

In C# there are Object and object types. They seem to have the same functionnality, so what is the difference between the two ?

Community
  • 1
  • 1
slaphappy
  • 6,894
  • 3
  • 34
  • 59

4 Answers4

63

There is none. C# provides synonyms for the primitives defined by the CLR. System.String -> string, System.Int64 -> long, System.Object -> object, etc.

Matt Greer
  • 60,826
  • 17
  • 123
  • 123
13

No difference.

object is a synomym of System.Object

It is there to allow old users to not get totally confused when they moved from an older system to this.

Wildhorn
  • 926
  • 1
  • 11
  • 30
  • 3
    What do you mean by old users? The only people I've ever seen use `Object` instead of `object` are Java programmers :) – Matt Greer Jun 18 '10 at 14:52
  • That's what I mean. People are used to use "object" so to not force them to use "Object", they still have "object" – Wildhorn Jun 18 '10 at 15:21
  • C# devs that started deving back on asp.net 2 and before. Every object or int I ran into was Object or Int32. – DeadlyChambers Apr 02 '15 at 19:29
7

I don't believe they are different, its like the difference between System.Int32 and int... they are the same essentially.

Brian Mains
  • 50,520
  • 35
  • 148
  • 257
6

None.

The object type is an alias for System.Object in the .NET Framework. You can assign values of any type to variables of type object.

http://msdn.microsoft.com/en-us/library/9kkx3h3c%28VS.71%29.aspx

mt0321
  • 93
  • 4