CSharp examples for Custom Type:Enum
Enum type Day Counter
using System;//from w w w .j av a 2 s . c o m enum Day {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday} public class SimpleDayCounter { public static void Main() { Day currentDay = Day.Monday; int counter = 1; while (counter < 8) { Console.WriteLine(counter); if(currentDay == Day.Thursday) Console.WriteLine("\tIt's Thursday"); if(currentDay == Day.Sunday) Console.WriteLine("\tIt's Sunday"); counter++; currentDay++; } } }