CSharp examples for Custom Type:Enum
An enumeration is a set of named integer constants.
C# enumerations contains its own values and cannot inherit or cannot pass inheritance.
The general syntax for declaring an enumeration is ?
enum <enum_name> { enumeration list };
using System;/*from www . j a v a 2 s . c o m*/ class EnumProgram { enum Days { Sun, Mon, tue, Wed, thu, Fri, Sat }; static void Main(string[] args) { int WeekdayStart = (int)Days.Mon; int WeekdayEnd = (int)Days.Fri; Console.WriteLine("Monday: {0}", WeekdayStart); Console.WriteLine("Friday: {0}", WeekdayEnd); } }