枚举部分 Enumeration part 使用枚举我们可以定义一些有名字的数字常量. 枚举通过 enum关键字来定义. Using enumerations, we can define some numeric constants with names. Enumeration is defined by the enum keyword. enum Direction { Up = 1, Down, Left, Right } 枚举是在运行时真正存在的一个对象,其中一个原因是因为这样可以从…