Understanding Value Types

Value types are data types that directly store data that they define. For example, a System.Int32 object represents a value type that can store an integer number as in the following line of code:

Dim anInteger As System.Int32 = 5

Among value types, the most common are numeric types that enable, for example, performing math operations or implementing counters or just storing a numeric value. Value types enable developers to choose the best data type according to the particular scenario. As we mentioned at the beginning of this chapter, value types are basically Structure objects. The .NET Framework provides several built-in value types that cover most needs in your development process, although you can create custom ...

Get Visual Basic® 2010 Unleashed 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.