VB.NET 1.1 Tutorial - The Namespace Keyword


The Namespace keyword is used to declare the name of a Namespace.

Namespace myName
  ' ...
End Namespace  

myName must be unique. The access modifier of a Namespace is Public and cannot be changed. A Namespace always finishes with the End keyword.

A Namespace can be seen as a container for some classes in much the same way that a folder on your file system contains files. By putting the classes into namespaces we can group related classes together. If two classes have the same name, by placing them in different namespaces, we avoid the risk of name collisions.


References

For more information on the Namespace Statement, visit MSDN at microsoft here.

What Next?

Return to the Tutorial Contents.