CSharp - Type Creation Field initialization


Field initialization is optional.

An uninitialized field has a default value (0, \0, null, false).

Field initializers run before constructors:

int Age = 10;

Declaring multiple fields together

You may declare multiple fields of the same type in a comma-separated list.

For example:

static readonly int legs = 8, eyes = 2, anotherIn = 9;