Back to course

Enums and Structs

.NET Zero to Hero: Master C# and Modern App Development

Enums and Structs

Enum:

A special class that represents a group of constants (unchangeable variables). csharp enum Level { Low, Medium, High } Level myVar = Level.Medium;

Struct:

Similar to classes but are value types and generally used for small data structures (like coordinates or points). csharp struct Point { public int X; public int Y; }