Export (0) Print
Expand All

private Modifier

Declares that a class member has private visibility.

private statement

Arguments

statement
Required. A class member definition.

Remarks

The private modifier makes a member of a class visible only within that class. Code outside the current class, including derived classes, cannot access private members.

Classes and interfaces in the global scope cannot be marked with the private modifier. Any member of a class or interface (including nested classes and nested interfaces) can be marked with the private modifier.

You may not combine the private modifier with any of the other visibility modifiers (public, protected, or internal).

Requirements

Version .NET

See Also

Modifiers | public Modifier | protected Modifier | internal Modifier | var Statement | function Statement | class Statement | Variable Scope

Show:
© 2014 Microsoft