Definition of Class |
|
Modifier |
Meaning |
1 |
None or internal |
Classes can only be accessed in the current project and cannot be accessed after other projects are referenced |
2 |
Public |
can access the class anywhere |
3 |
Abstract |
cannot be instantiated, only for inheritance |
4 |
Sealed |
cannot be used for derivation, can only be instantiated |
5 |
Internal abstract |
1+3 |
6 |
public abstract |
2+3 |
7 |
Internal sealed |
1+4 |
8 |
public sealed |
2+4 |
|
|
|
Definition of a Member |
1 |
Public |
Members can be accessed by any code. |
2 |
Protected |
Members can only be accessed by code in a class or derived class. |
3 |
Internal |
Members can only be accessed by code inside the assembly. |
4 |
protected internal |
They can only be accessed by the code of the derived class in the assembly. |
5 |
Private |
Members can only be accessed by code in the class (this keyword is used by default if no keyword is used). |
6 |
Static |
Declares fields, methods, and properties, which means that they are static members of a class, not members of an object instance |
Class definition, member-defined modifiers