using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConstAndEnum
{
public enum weekdays
{
sunday,
monday
}
// demonstrates how to use the enum
class Program
{
static void Main()
{
// create and initialize
// instance of enum type
//Volume myVolume = Volume.High;
weekdays wK = weekdays.monday;
// make decision based
// on enum value
switch (wK)
{
case weekdays.sunday:
Console.WriteLine("the day isa sunday.");
break;
case weekdays.monday:
Console.WriteLine("The day is monday.");
break;
}
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConstAndEnum
{
public enum weekdays
{
sunday,
monday
}
// demonstrates how to use the enum
class Program
{
static void Main()
{
// create and initialize
// instance of enum type
//Volume myVolume = Volume.High;
weekdays wK = weekdays.monday;
// make decision based
// on enum value
switch (wK)
{
case weekdays.sunday:
Console.WriteLine("the day isa sunday.");
break;
case weekdays.monday:
Console.WriteLine("The day is monday.");
break;
}
Console.ReadLine();
}
}
}
0 comments:
Post a Comment