Members

Most types can contain zero or more members of the following sorts:

Fields: Used to store data, typically hidden from the outside to establish abstraction and encapsulation.

Methods: Define operations that can be carried out on the type or instances thereof.

Constructors: Used to create an object instance of the containing type; in fact, constructors are special methods in disguise.

Finalizer: A type can have one finalizer method that gets called when the garbage collector reclaims its memory. This is typically used to clean up native resources that object instances hold on to.

Properties: Provide get and set accessors to the state of the type or instances thereof. Properties are a syntactical veneer over getter and setter methods ...

Get C# 4.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.