When you declare an enum, by default each enumerated value is represented internally with an int. (System.Int32 – 4 bytes). You can convert between values of the underlying type and enum values using an explicit cast. Because anenum is represented by an int by default, you can convert between integers and enum values.
1 2 3 4 5 6 | Mood m = (Mood)2;Console.WriteLine(m); // Petulantm = Mood.Crabby;int i = (int)m;Console.WriteLine(i); // 0 |

