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

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.

主站蜘蛛池模板: 邵阳市| 桓台县| 山东| 古浪县| 湖北省| 上思县| 阿勒泰市| 靖安县| 乌拉特前旗| 广河县| 吴桥县| 河源市| 洱源县| 墨竹工卡县| 广德县| 竹溪县| 崇州市| 龙州县| 拉孜县| 喀喇沁旗| 来凤县| 宜丰县| 邯郸市| 白城市| 淮滨县| 竹山县| 武清区| 汪清县| 永定县| 和田市| 宁武县| 甘谷县| 明光市| 黔西| 留坝县| 凉城县| 慈溪市| 侯马市| 南召县| 郓城县| 扎鲁特旗|