Visual Basic (.NET)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 68.44.23.16 (talk) at 15:33, 11 April 2007 (→‎Visual Basic .NET 2003). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Visual Basic .NET
File:Vb dot net.png
Paradigmstructured, imperative, object-oriented
Designed byMicrosoft Corporation
First appeared2001 (last revised 2005)
Typing disciplinedynamic, strong, unsafe[1], nominative
Websitedocs.microsoft.com/en-us/dotnet/visual-basic/,%20https://docs.microsoft.com/ja-jp/dotnet/visual-basic/
Major implementations
.NET Framework, Mono
Dialects
Microsoft Visual Studio .NET, .NET 2003, 2005
Influenced
None

Visual Basic .NET (VB.NET) is an object-oriented computer language that can be viewed as an evolution of Microsoft's Visual Basic (VB) implemented on the Microsoft .NET framework. Its introduction has been controversial, as significant changes were made that broke backward compatibility with VB and caused a rift within the developer community.

The great majority of VB.NET developers use Visual Studio .NET as their integrated development environment (IDE). SharpDevelop provides an open-source alternative IDE.

Like all .NET languages, programs written in VB.NET require the .NET framework to execute.

Versions of Visual Basic .NET

As of November 2006 there are three versions of Visual Basic .NET.



Cross-platform and open-source development

The creation of open-source tools for VB.NET development have been slow compared to C#, although the Mono development platform provides an implementation of VB.NET-specific libraries and is working on a compiler, as well as the Windows Forms GUI library.[citation needed]

Hello World Example

The following is a very simple VB.Net program, a version of the classic "Hello world" example:

Public Class ExampleClass
 
	Public Shared Sub Main()
		System.Console.WriteLine("Hello, world!")
	End Sub

End Class

The effect is to write the text Hello, world! to the output console. Each line serves a specific purpose, as follows:

Public Class ExampleClass

This is a class definition. It is public, meaning objects in other projects can freely use this class. All the information between this and the following End Class describes this class.

Public Shared Sub Main()

This is the entry point where the program begins execution. It could be called from other code using the syntax ExampleClass.Main(). (The Public Shared portion is a subject for a slightly more advanced discussion.)

System.Console.WriteLine("Hello, world!")

This line performs the actual task of writing the output. Console is a system object, representing a command-line console where a program can input and output text. The program calls the Console method WriteLine, which causes the string passed to it to be displayed on the console.

See also

Notes

  1. ^ Only if strict type checking (Option Strict) is not enabled. Many VB.NET developers assert that strict type checking must be enabled in all new projects and only disabled for legacy code converted by the Upgrade Wizard.

External links

Tutorials