default Operator

suggest change

Value Type (where T : struct)

The built-in primitive data types, such as char, int, and float, as well as user-defined types declared with struct, or enum. Their default value is new T() :

default(int)            // 0
default(DateTime)       // 0001-01-01 12:00:00 AM
default(char)           // '\0' This is the "null character", not a zero or a line break.
default(Guid)           // 00000000-0000-0000-0000-000000000000
default(MyStruct)       // new MyStruct()

// Note: default of an enum is 0, and not the first *key* in that enum
// so it could potentially fail the Enum.IsDefined test
default(MyEnum)         // (MyEnum)0

Reference Type (where T : class)

Any class, interface, array or delegate type. Their default value is null :

default(object)         // null
default(string)         // null
default(MyClass)        // null
default(IDisposable)    // null
default(dynamic)        // null

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Operators:
* Syntax
* default Operator
* sizeof
* typeof

Table Of Contents
2 Operators
17 Regex
19 Arrays
21 Enum
22 Tuples
24 GUID
27 Looping
36 Casting
46 Methods
88 Events
92 Structs
104 Indexer
106 Stream
107 Timers
109 Threading
127 Caching
135 Pointers
147 C# Script