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 the object-oriented programming as we see later in the book. Reference types have one big difference versus value types: Variables that declare a reference type do not store the data of the type itself, whereas 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, an example is necessary. Consider the following class Person
, which exposes two simple properties:
You need to instantiate ...
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.