O'Reilly logo

Programming Visual Basic .NET, Second Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Variables and Constants

A variable is a storage location with a type. The type will be one of the intrinsic types (variables of user-defined types are called objects, and are explained in Chapter 5). In the examples in Section 3.2.3, both myInteger and myDouble are variables. Variables can have values assigned to them, and those values can be changed programmatically.

You create a variable by declaring its type and then giving it a name. You can initialize the variable when you declare it, and you can assign a new value to that variable at any time, changing the value held in the variable. Example 3-1 initializes the variable myInteger with the value ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required