Notice that when you are assigning
a value to an enum variable,
you must scope the enum
name (EmpType) to the value (Grunt). Because enumerations are a fixed set of name/value pairs, it is
illegal to set an enum variable to a value that is not defined directly by the enumerated type:
static void Main(string[] args)
{
Console.WriteLine("**** Fun with Enums *****");
Do'stlaringiz bilan baham: