21.4 Enum values and operations
来源:互联网 发布:360软件管家打不开 编辑:程序博客网 时间:2024/05/20 22:03
Each enum type defines a distinct type; an explicit enumeration conversion (
§13.2.2) is required to convert
between an enum type and an integral type, or between two enum types. The
set of values that an enum type
can take on is not limited by its enum members. In particular, any value of
the underlying type of an enum
can be cast to the enum type, and is a distinct valid value of that enum
type.
Enum members have the type of their containing enum type (except within
other enum member initializers:
see §21.3). The value of an enum member declared in enum type E with
associated value v is (E)v.
The following operators can be used on values of enum types: ==, !=, <, >,
<=, >= (§14.9.5), + (§14.7.4),
- (§14.7.5), ^, &, | (§14.10.2), ~ (§14.6.4), ++, -- (§14.5.9 and §14.6.
5), and sizeof (§25.5.4).
Every enum type automatically derives from the class System.Enum (which, in
turn, derives from
System.ValueType and object). Thus, inherited methods and properties of
this class can be used on
values of an enum type.
§13.2.2) is required to convert
between an enum type and an integral type, or between two enum types. The
set of values that an enum type
can take on is not limited by its enum members. In particular, any value of
the underlying type of an enum
can be cast to the enum type, and is a distinct valid value of that enum
type.
Enum members have the type of their containing enum type (except within
other enum member initializers:
see §21.3). The value of an enum member declared in enum type E with
associated value v is (E)v.
The following operators can be used on values of enum types: ==, !=, <, >,
<=, >= (§14.9.5), + (§14.7.4),
- (§14.7.5), ^, &, | (§14.10.2), ~ (§14.6.4), ++, -- (§14.5.9 and §14.6.
5), and sizeof (§25.5.4).
Every enum type automatically derives from the class System.Enum (which, in
turn, derives from
System.ValueType and object). Thus, inherited methods and properties of
this class can be used on
values of an enum type.
- 21.4 Enum values and operations
- java enum values()方法
- Text description for enum values
- Kubernetes and Container Operations
- 枚举(Enum)中的values()方法揭秘
- Map enum in JPA with fixed values?
- Enum中values()方法取值顺序
- ENUM values missing in SRSANALYSISENUMS Table
- java枚举enum类中的values()
- 枚举类enum的values()方法
- MISSION AND VALUES
- FORALL(INDICES AND VALUES)
- Primitive values and Objects
- Integral Types and Values
- C++ Overloaded operations and Conversions
- Bit shifting and bitwise operations
- Derivatives operations and processing standard
- Blocks, Operations, and Retain Cycles
- 20.4 Interface implementations
- 21. Enums
- 21.1 Enum declarations
- 21.2 Enum modifiers
- 21.3 Enum members
- 21.4 Enum values and operations
- 22. Delegates
- 22.1 Delegate declarations
- 22.2 Delegate instantiation
- 22.3 Delegate invocation
- 预处理
- 用实例学简单的网络通讯-双机互连
- 被动生存
- 爱因森学籍管理系统客户建议