Default Values Table (C# Reference)

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

The following table shows the default values of value types returned by the default constructors. Default constructors are invoked by using the new operator, as follows:

int myInt = new int();  

The preceding statement has the same effect as the following statement:

int myInt = 0;  

Remember that using uninitialized variables in C# is not allowed.

Value typeDefault value
boolfalse
byte0
char'\0'
decimal0.0M
double0.0D
enumThe value produced by the expression (E)0, where E is the enum identifier.
float0.0F
int0
long0L
sbyte0
short0
structThe value produced by setting all value-type fields to their default values and all reference-type fields to null.
uint0
ulong0
ushort0

C# Reference
C# Programming Guide
Value Types Table
Value Types
Built-In Types Table
Reference Tables for Types

Show: