O'Reilly logo

Essential C# 7.0, Sixth Edition by Mark Michaelis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9. Value Types

You have used value types throughout this book; for example, int is a value type. This chapter discusses not only using value types but also defining custom value types. There are two categories of custom value types: structs and enums. This chapter discusses how structs enable programmers to define new value types that behave very similarly to most of the predefined types discussed in Chapter 2. The key is that all newly defined value types have their own custom data and methods. The chapter also discusses how to use enums to define sets of constant values.

A figure shows the "Value Types" mind-map.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required