CSharp - Type Creation Field Definition


A field is a variable that is a member of a class or struct. For example:

class Person
       string name;
       public int Age = 10;

Fields allow the following modifiers:

Static modifier static
Access modifiers public internal private protected
Inheritance modifier new
Unsafe code modifier unsafe
Read-only modifierreadonly
Threading modifier volatile