Your Ad Here

Friday, August 14, 2009

Imports Statement

The Imports statement is used to import namespaces.

Using this statement prevents you to list the entire namespace when you refer to them.


Example of Imports Statement
The following code imports the namespace System.Console and uses the methods of that namespace preventing us to refer to it every time we need a method of this namespace.



Imports System.Console

Module Module1

Sub Main()

Write("Imports Statement")

WriteLine("Using Import")

End Sub

End Module


The above two methods without an imports statement would look like this: System.Console.Write("Imports Statement") and System.Console.WriteLine("Using Import")

No comments:

Post a Comment

Your Ad Here