© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
G. ByrneTarget C#https://doi.org/10.1007/978-1-4842-8619-7_20

20. Enumerations

Gerard Byrne1  
(1)
Belfast, Ireland
 

Concept of Enumerations

In the last chapter, we learned about the struct, which is a C# type and is similar to a class, encapsulating data and functionality, that is, variables and methods. We saw that a struct can have a custom constructor, but will always have a default parameterless constructor , and the struct can contain properties for accessing the private members. In terms of accessibility, we saw that the struct could be made readonly, which means all fields automatically become set as readonly. However, we learned that from C# 8 individual ...

Get Target C#: Simple Hands-On Programming with Visual Studio 2022 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.