Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Specifies that one or more declared programming elements have no access restrictions.
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.
Public
only at module, interface, or namespace level. This means the declaration context for a Public
element must be a source file, namespace, interface, module, class, or structure, and cannot be a procedure.Access Level. All code that can access a module, class, or structure can access its Public
elements.
Default Access. Local variables inside a procedure default to public access, and you cannot use any access modifiers on them.
Access Modifiers. The keywords that specify access level are called access modifiers. For a comparison of the access modifiers, see Access levels in Visual Basic.
The Public
modifier can be used in these contexts:
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now