Ad space (banner)
๐Ÿ”ทVB.NET Lessons
Lesson 2 / 68

Your first output (Console.WriteLine)

This lesson covers the basics of printing in VB.NET with Console.WriteLine, with the aim of getting a feel for what kind of language VB.NET is.

Console.WriteLine displays text on the screen. Visual Basic is widely used for Windows applications and for extending Office macros. VB.NET runs on .NET, so it uses the same libraries as C# while letting you write in a syntax much closer to plain English.

In the sample code, a single line — Console.WriteLine("Hello, Visual Basic!") — sits inside the fixed Module Program and Sub Main() frame. It shares its structure with the other .NET languages while keeping keywords close to ordinary English words.

A common early stumble is getting used to bracketing a block between a start and an End keyword. Unlike brace languages, VB.NET marks the end of a block with End Something.

Printing to the screen is the first step in seeing what a program is doing, and it is used constantly while debugging to check the contents of a variable. In professional work it turns up everywhere, from logging in a Windows application to checking an Office macro.

๐Ÿ“– Reference code
โœ๏ธ Your code
Type your code, then press "Run"

๐Ÿงช This site can't compile or run VB.NET directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ€” nothing is sent anywhere).

Ad space (banner)
Ad space (in-article)