Chapter 10. Values and Objects

Chapter 3 outlined the fundamental differences between value types and reference types. Values are instances created from value types. The CLR treats a value as a simple, formatted chunk of memory. Objects are instances created from reference types. The CLR treats objects much differently than values; it allocates memory for objects on the managed heap and allows you to access them only through the use of references.

This chapter focuses on how the creation of values and objects affects the way that the CLR manages memory within a running application. It begins with a discussion of creating user-defined values types using the Enum construct and the Structure construct. The chapter also explains how designing in ...

Get Building Applications and Components with Visual Basic .NET 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.