C# enum

Enum in C# is also known as enumerations. It basically refers to a named set of constants such as months, days, seasons, etc.

Enum improves type safety. They contain fixed set of constants and they can be traversed. We can define Enum outside or within the class or structs.

Let’s see a simple example of enum in C#.

C# Enum Example:


C# Enum Example: Traversing all values


Leave a Comment