C#枚举
摘要:
public class EnumTest{ enum Days { Sun, Mon, Tue, Wed, Thu, Fri, Sat }; static void Main() { int x = (int)Days.Sun; int y = (int)Days.Fri; Console.WriteLine("Sun = {0}", x); Console.WriteLine("Fri = {0}", y); }}/* Output: Sun = 0 Fri = 5*/enum 关键字用于声明枚举,即一... 阅读全文
posted @ 2011-11-22 11:34 老戴学代码 阅读(241) 评论(0) 推荐(0) 编辑