enums example c#
Example 1: enumeratio nc sharp
enum Products
{
Apple = 0,
Milk = 1,
Vodka = 2,
}
Console.Writeline(Products.Milk); // Output = Milk
Console.Writeline((int)Products.Milk); // Output = 1
Example 2: c# enum syntax
enum State
{
Idle,
Walking,
Running,
Jumping,
Climbing,
Attacking
}