Previous section   Next section

Chapter 2. Getting Started: "Hello World"

It is a time-honored tradition to start a programming book with a "Hello World" program. In this chapter, we will create, compile, and run a simple "Hello World" program written in Visual Basic .NET. The analysis of this brief program will introduce key features of the Visual Basic .NET language.

Example 2-1 illustrates the fundamental elements of a very simple Visual Basic .NET program.

Example 2-1. A simple "Hello World" program in VB.NET
   Module HelloWorld
   ' every console app starts with Main
      Sub Main( )
         System.Console.WriteLine("Hello World")
      End Sub
   End Module

That is the entire program. Compiling and running it displays the words "Hello World" at the console.


  Previous section   Next section
Top