A variable is an object that has a name and a value. The name is necessary so we can distinguish a variable from all the other ones. The value is essentially the “state” of a variable. The value of a variable can change as a program executes (hence the name “vari-able”, able to change).
The name of a variable is made up of letters and digits. A variable name starts with an underscore symbol (_) or a letter. Then it can be followed by any number of digits, letters or underscore symbols. In Visual Basic, variable names are not case sensitive. This means the names currentBalance, CurrentBalance and CURRENTBALANCE are only a few examples to refer to the same variable. Many other programming languages, such as C, C++, Java, Perl, PHP, Python and etc. are case sensitive.
A variable also has a type associated with it. The type of a variable determines how it can be used. As a scripting language, the type of a variable can change as a program executes. We’ll revisit the concept of a type later on.