访问修辞符 enum 枚举名:基础类型
{
枚举成员
}
示例:
public enum TimeofDay:uint
{
Morning=-3,
Afternoon=-2,
Evening=-1
}
产生编译时错误,原因是常数值 -1、-2 和 –3 不在基础整型 uint 的范围内。