using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
enum Gender { Male, Female, Unknown };
class Program
{
static void Main(string[] args)
{
//枚举类型 枚举的意义就在于限定变量的取值范围
Gender g = Gender.Male;
Console.WriteLine(g);
Console.ReadKey();
}
}
}
转载于:https://blog.51cto.com/soukenan/1076238