static void Main() { Day1 whatDay = Day1.Sunday; Console.WriteLine("{0}", whatDay); //Sunday Console.WriteLine("{0}", (int)whatDay); //6 whatDay = (Day1)6; Console.WriteLine("{0}", whatDay); //Sunday Day2 whatDay2 = Day2.Monday; Console.WriteLine("{0}", whatDay2); //Monday Console.WriteLine("{0}", (byte)whatDay2); //11 whatDay2 = (Day2)111; Console.WriteLine("{0}", whatDay2); //Sunday }
static void Main(string[] args) { Day1 whatDay = Day1.Sunday; Console.WriteLine("{0}", whatDay); Console.WriteLine("{0}", (int)whatDay); whatDay = (Day1)6; Console.WriteLine("{0}", whatDay); Day2 whatDay2 = Day2.Monday; Console.WriteLine("{0}", whatDay2); Console.WriteLine("{0}", (byte)whatDay2); whatDay2 = (Day2)111; Console.WriteLine("{0}", whatDay2); }