Visual Basic.NET 2008 > Using Variables and Data Types
Types of Variables in Visual Basic 2008Visual Basic recognizes the following five categories of variables:
The two major variable categories are numeric and string. Numeric variables store numbers, and string variables store text. Object variables can store any type of data. Why bother to specify the type if one type suits all? On the surface, using object variables might seem like a good idea, but they have their disadvantages. Integer variables are optimized for storing integers, and date variables are optimized for storing dates. Before VB can use an object variable, it must determine its type and perform the necessary conversions. If the variable is declared with a specific type, these conversions are not necessary. We begin our discussion of variable types with numeric variables. Text is stored in string variables, but numbers can be stored in many formats, depending on the size of the number and its precision. That's why there are many types of numeric variables. The String and Date data types are much richer in terms of the functionality they expose, and are discussed in more detail in Chapter, ‘‘Handling Strings, Characters, and Dates.''
More on Types of Variable:
Table of Contents
|
|||||
W3computing.com Copyright 2011 © All Rights Reserved
|
|||||
| Home | Useful links | Contact us | |||||