Name

Namespace Statement

Syntax

Namespace name
                     component types
End Namespace
name (required; String literal)

The name of the namespace

component types (required)

The elements that are being declared as part of the namespace, including Enums, Structures, Interfaces, Classes, Delegates, Modules, and other namespaces

Description

Declares a namespace and specifies the items in the namespace

Rules at a Glance

  • Namespaces are used in the .NET Framework as an organized method of exposing program components to other programs and applications.

  • Namespaces are always Public. However, the elements within a namespace can be Public, Friend, or Private. Private members are available only within the namespace declaration.

  • name, the namespace name, must be unique.

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.