What is the difference between uppercase and lowercase objects?

Possible duplicate:
C #: difference between "System.Object" and "object"

Although I am currently working with C #, this question may be applicable to other languages.

Is there a difference between calling Object vs. Object ? In particular, I created a Dictionary instance with a constructor:

 Dictionary<String, Object> foo = new Dictionary... 

The IDE is automatically populated with new Dictionary<string, object> . I came back and changed my original expression, but I became interested.

  • Are there any adverse reactions when I use the uppercase letters String or Object in comparison with the lowercase letters String or Object ?
  • I assume that uppercase refers to the class (so I can therefore refer to the methods of the class), while lowercase letters just refer to the type. It's true?
+7
source share
2 answers

object is the keyword (alias) for System.Object, the same goes for string .

When compiling, it will be exactly the same.

The MSDN page for object says the following:

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

You can find a long list of all keywords in C # on MSDN .

+16
source

There are several classes that have aliases, such as object, string, int, short, and some others. All of them are internally mapped to real capitalized classes.

Please note that some rare types are platform dependent. For example. on x86, IntPtr stores a 32-bit value, and on x64, a 64-bit value.

short so far I know, always mapped to Int16 and long before Int64.

0
source

All Articles