Chapter 8

Understanding values and references

After completing this chapter, you will be able to:

  • Explain the differences between a value type and a reference type.

  • Understand null values and how nullable types work.

  • Modify how arguments are passed as method parameters by using the ref and out keywords.

  • Describe how computer memory is organized to support value types and reference types.

  • Convert a value into a reference by using boxing.

  • Convert a reference back to a value by using unboxing and casting.

Chapter 7, “Creating and managing classes and objects,” demonstrated how to declare your own classes and how to create objects by using the new keyword. That chapter also showed you how to initialize an object by using a constructor. In this ...

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.