C# - Terminology - Class, member, field, property and method


The definition of a type; specifically a type that contains data and the methods that operate on that data. Compare to struct.


A field, property or method within a class.


A data member that is accessed directly. Also called a member variable.


A data member that is accessed through a property acessor (via generated get_Prop() and set_Prop() methods).


A procedure or function.

An example:

  class Test // a class
      private string _firstName; // a member. a field.
      public string FirstName // a member. a property
          get { return _firstName; }
      public void Print() // a member. a method
          Console.WriteLine("Hello " + _firstName);

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath