Public - Visual Basic (original) (raw)

Specifies that one or more declared programming elements have no access restrictions.

Remarks

If you are publishing a component or set of components, such as a class library, you usually want the programming elements to be accessible by any code that interoperates with your assembly. To confer such unlimited access on an element, you can declare it with Public.

Public access is the normal level for a programming element when you do not need to limit access to it. Note that the access level of an element declared within an interface, module, class, or structure defaults to Public if you do not declare it otherwise.

Rules

Behavior

The Public modifier can be used in these contexts:

Class Statement

Const Statement

Declare Statement

Delegate Statement

Dim Statement

Enum Statement

Event Statement

Function Statement

Interface Statement

Module Statement

Operator Statement

Property Statement

Structure Statement

Sub Statement

See also