Summary

In this hour we examined the syntax and semantics for variables and operators in VB.NET. A variable is defined by three properties: its name, its data type, and its value. The name and data type of a variable are specified when the variable is declared and are immutable. Variables are declared in VB.NET via the Dim statement in the following fashion:

Dim variableName as type
					

The type of a variable dictates what values the variable can contain. Each type has a subset of legal values. For example, a variable of type Integer can store negative or positive whole numbers that range from –2,147,483,648 to 2,147,483,647.

A variable is assigned a value via an assignment statement, which is = in VB.NET. Along with the assignment operator, there ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.