So far we have used Console, Double, String and ArrayList. (Three of these types are classes; the other one is a structure.) Unless the organisation of names is more complicated, we would quickly run out of names. To avoid name clashes, each name is allocated to a namespace.
For example, Console, Double and String belong to the System namespace.
If we wish, we can fully qualify all the names we use:
Dim tCentigradeString As System.String = System.Console.ReadLine()
Some namespaces have subnamespaces. For example, the System namespace has a subnamespace called Collections. And ArrayList belongs to this subnamespace. So you could write:
Dim tLanguages As System.Collections.ArrayList = New System.Collections.ArrayList(2)
Obviously, it is tedious to use fully qualified names: they can be avoided by using an Imports statement. So, if your program starts with the lines:
Imports System Imports System.Collections Module Module1
you can use any of the classes of the System namespace or the System.Collections namespace without fully qualifying their names.
If you are using Visual Studio.NET (rather than using the vbc command), some Imports statements can be omitted. When using Visual Studio.NET, you do not need:
Imports System Imports System.Collections Imports System.Data Imports System.Diagnostics Imports System.Drawing Imports System.Windows.Form Imports Microsoft.VisualBasic