3

More with Data Types

In Chapter 2, we covered all the C# predefined types and briefly touched on the topic of reference types versus value types. In this chapter, we continue the discussion of data types with further explanation of the categories of types.

Images

In addition, we delve into the details of combining data elements together into tuples—a feature introduced in C# 7.0—followed by grouping data into sets called arrays. To begin, let’s delve further into understanding value types and reference types.

Categories of Types

All types fall into one of two categories: value types and reference types. The differences between the types in each ...

Get Essential C# 12.0, 8th 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.