地图和枚举是完全不同的数据结构。地图是将值与关键。为使类型安全的枚举常数。比较是不可能的!
Maps and enums are completely different data structures. Maps are for associating a value with a key. Enums are for make typesafe constants. Comparing the two is impossible!
当枚举定义的简单类型使用常数的特殊列表时,就会需要这种类型了。
It is needed when there should be a specific list of constant values to be used for the simple type defined by the enumeration.
常数可以是整数、字符、浮点数、字符串、Boolean、octet或枚举型,但不能是any类型或用户定义的类型。
Your constants can be integer, character, floating-point, string, Boolean, octet or enumerated but not of type any or a user-defined type. Here are some examples.
应用推荐