Field initialization - CSharp Custom Type

CSharp examples for Custom Type:Field

Introduction

Field initialization is optional.

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

Field initializers run before constructors:

public int Age = 10;


class Animal
{
    public int Age = 10;
}

Related Tutorials