Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What does the question mark mean in the definition of C# variables?
What does the question mark mean in the definition of C# variables?
A question mark in the definition of a C# variable indicates that the variable is allowed to be empty.

Nullable types can represent null values of the underlying type, or they can represent. null? Value. ? Types that can be null can be declared in one of two ways:

System. Can be empty & ltT>? Variable-or-

t? variableT? Is the base type of nullable type. ? t? Can it be included? struct? Any value type, including: but it cannot be a reference type.

-

You can view MSDN null: nullable types (C# programming guide) and using nullable types (C# programming guide).