Chapter 9
Creating value types with enumerations and structures
After completing this chapter, you will be able to:
Declare an enumeration type and create an enumeration variable.
Declare a structure type and create a structure variable.
Explain the differences in behavior between a structure and a class.
Chapter 8, “Understanding values and references,” covers the two fundamental types that exist in Microsoft Visual C#: value types and reference types. Recall that a value type variable holds its value directly on the stack, whereas a reference type variable holds a reference to an object on the heap. Chapter 7, “Creating and managing classes and objects,” demonstrated how to create your own reference types by defining classes. In this chapter, ...
Get Microsoft Visual C# Step by Step, 10th Edition 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.