- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 79字
- 2021-07-15 17:05:30
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.
推薦閱讀
- Mastering Concurrency Programming with Java 8
- Java范例大全
- Intel Galileo Essentials
- Interactive Data Visualization with Python
- The DevOps 2.4 Toolkit
- C++ 從入門到項目實踐(超值版)
- C語言程序設計
- Java編程技術與項目實戰(第2版)
- Node.js Design Patterns
- C語言程序設計上機指導與習題解答(第2版)
- RSpec Essentials
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- OpenGL Data Visualization Cookbook
- UX Design for Mobile
- Android技術內幕(系統卷)