Familiarize with the Visual Basic development environment
Write your first Visual Basic program
We will create a simple program that displays the message Hello World on the screen.
Namespaces provide a hierarchical means of organizing the elements of one or more programs. An analogy would the naming of cities. Do you know that there are two cities named Austin in the world? One is in the USA and the other in Argentina. If you want to send mail to either city, you would write either Austin, USA or Austin, Argentina to be unambiguous. Country names like USA and Argentina in Visual Basic are called namespaces. In Visual Basic, the default namespace is the filename you gave. For your first program, the namespace is HelloWorld
A namespace is usually made up of one or more classes. A class is a definition for a specific kind of object. In subsequent exercises you will noticed that all the automatically generated codes have the same class called Module1. Thanks to the namespace difference, there is no confusion.
To make the transition from VB6 to VB .NET easier, the Module keyword is used instead of Class keyword. VB .NET converts the modules to classes automatically.
Fortunately for us, many classes are already predefined for the more common tasks that we need to do. In this program we make use of the Console class.
The hello world output is produced using the WriteLine method of the Console Class in the System namespace.
The Main method is a member of the module Module1. The entry point of this application is the method named Main.
Please note the following while editing your Visual Basic code to avoid compilation errors
' This is a comment