Capital letters in data types

Hi to all!

Just a maybe simple and small question. Does anybody could explain me what is the difference between capital letter and small letter at the beginning of a datatype

I mean what is the diferrence between:

Double (with big D) and double (with small d)

Both works when declaring a variable but what is behind this

Thanks a lot in advance!




Answer this question

Capital letters in data types

  • DavidThi808

    The type names that start with a capital letter are .NET base class library type names. To use them you either have to import the System namespace (with a using System; statement) or fully qualify them (e.g. System.Double).

    The lower case type names are C# keywords. They work in any context regardless of namespace imports and can be seen as aliases for the BCL type names.

    Note that while the the names are sometimes the same (string/String, double/Double) they can also be slightly different (int/Int32, ulong/UInt64, bool/Boolean) so it's not just a difference in case. But the end result in the compiled code is the same so you can pretty much choose the name you prefer.



  • MyBoysCanSwim

    Thanks a lot for the useful information! :-))

  • Capital letters in data types