default (C# Reference)

 

Updated: July 20, 2015

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

The default keyword.

The default keyword can be used in the switch statement or in generic code:

  • The switch statement: Specifies the default label.

  • Generic code: Specifies the default value of the type parameter. This will be null for reference types and zero for value types.

C# Reference
C# Programming Guide
C# Keywords

Show: