Class declarations define new reference types. A class can inherit from another class, and can implement interfaces.
Class members can include constants, fields, methods, properties, events, indexers, operators, instance constructors, destructors, static constructors, and nested type declarations. Each member has an associated accessibility (10.5), which controls the regions of program text that are able to access the member. There are five possible forms of accessibility. These are summarized in the table below. Form Intuitive meaning
public Access not limited
protected Access limited to the containing class or types derived from the containing class
internal Access limited to this program
protected
internal
Access limited to this program or types derived from the containing class
private Access limited to the containing type
The example shows a class that contains each kind of member. The example shows uses of these members.