LANGUAGE

default expression

Produces a type default value, such as zero for int or false for bool. A reference type default is null. It does not make an otherwise unassigned local safe to read.

Formal Syntax & Structure

csharp syntaxcsharp
default(<type>)  // or default when a target type is known

Working Example

Example Snippetcsharp
int count = default;bool ready = default(bool);System.Console.WriteLine(count);System.Console.WriteLine(ready);
C# & .NET Reference