0

While studying the Unity Singleton pattern, I saw code like this on the web. I've seen syntax starting with lowercase o. If you're implementing an object, don't you have to use capital O? Below is the phrase I saw.

private static object syncobj = new object();
GSerg
  • 76,472
  • 17
  • 159
  • 346
hey
  • 1
  • 1

1 Answers1

0

In the framework, the class is Object. But C# has an alias defined - object - which the compiler translates as Object during compilation.

C# does the same for a few other 'basic' types: int for Int32, long for Int64, and a few others I don't remember.

simon at rcl
  • 7,326
  • 1
  • 17
  • 24