Understanding Reference Types

Reference types are represented by classes. Classes are probably the most important items in modern programming languages and are the basis of object-oriented programming. Reference types have one big difference from value types. Variables that declare a reference type do not store the data of the type itself; they just store an address to the data. In other words, they are just pointers to the data. To better explain (and understand) this fundamental concept, let’s look at an example. Consider the following class, Person, which exposes two simple properties:

Class Person    Property FirstName As String    Property LastName As StringEnd Class

You need to create an instance of such a ...

Get Visual Basic 2015 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.