Declares the name of a namespace.
Namespace { name | name.name } [ componenttypes ] End Namespace
Namespaces are used as an organizational system - a way of presenting program components that are exposed to other programs and applications.
Namespaces are always Public; therefore the declaration of a namespace cannot include an access modifiers. However, the components within the namespace may have Public or Friend access. If it is not stated, the default access type is Friend.
The following example declares two namespaces.
Namespace N1 ' Declares a namespace named N1. Namespace N2 ' Declares a namespace named N2 within N1. Class A ' Declares a class within N1.N2. ' Add class statements here. End Class End Namespace End Namespace
The next example declares multiple nested namespaces on a single line, and is equivalent to the previous example.
Namespace N1.N2 ' Declares two namespaces; N1 and N2. Class A ' Declares a class within N1.N2. ' Add class statements here. End Class End Namespace
Imports Statement |