Application Development Using Visual Basic® and .NET
by Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
VB.NET Type System
In VB.NET, there is a fundamental distinction between value types and reference types. Value types have storage allocated immediately on the stack when the variable is declared. Reference types have storage allocated on the heap when they are instantiated, not when they are just declared, and the variable is only a reference to the actual object containing the data.
We have been looking at classes in some detail. A class defines a reference type. In this section we survey the entire VB.NET type system, including simple types such as Integer and Decimal. In VB.NET, a Structure has many similarities to a Class, but it is a value type. This means that assigning from one structure variable to another causes the entire structure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access