官术网_书友最值得收藏!

Enum

The enum data type will have a named set of values. We use enumerators to give user-friendly names to constants that identify certain values:

enum Day {Mon, Tue, Wed, Thu, Fri, Sat, Sun}; 
var firstDay: Day = Day.Mon; 

Here, we have the Day enum variable, which holds a series of values that represent each day of the week. The second statement shows how to access a particular enum value in a day and assign it to another variable.

主站蜘蛛池模板: 武义县| 阿拉尔市| 铁力市| 溆浦县| 阜南县| 翁源县| 深州市| 六盘水市| 龙口市| 汉沽区| 墨竹工卡县| 建水县| 松阳县| 丘北县| 璧山县| 正蓝旗| 宁阳县| 田东县| 涞源县| 钟祥市| 五大连池市| 泸水县| 邢台县| 大安市| 中阳县| 木兰县| 永新县| 霍山县| 满洲里市| 肥城市| 靖安县| 共和县| 子长县| 蕉岭县| 稻城县| 苏州市| 安丘市| 泽州县| 治多县| 祥云县| 沈丘县|