Language Basics C# Book

An enum value is convertable to its underline numeric value.
using System;
enum WeekDay
{
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
}
class Test
{
static void Main()
{
int i = (int)WeekDay.Monday;
Console.WriteLine(i);
//We can even convert integer back to enum value.
WeekDay day = (WeekDay)2;
Console.WriteLine(day);
}
}
The output:
0
Wednesday