21.4 Enum values and operations

原创 2006年06月22日 03:18:00
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.
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

java枚举enum类中的values()

**java枚举enum中的values()** 近两天在看spring源码时在用EA工具逆向生成spring-web的ER图看到了HttpMethod()这个枚举类,如图 这个类中的静态块 ...

Java Enum 类 的 values()方法 api没有,实例是怎么调用详解

源文件: 1 2 3 4 5 package test;   public enum EnumTest {     A, B...

Java中Enum类下的values()方法的由来

有如下Enum类: public enum Test{  A,B,C } 该类下有values()方法,但查API可知道java.lang.Enum下根本没有这个方法,该方法在java...
  • DA860
  • DA860
  • 2014-02-27 20:35
  • 807

CodeForces 339D Xenia and Bit Operations

链接:http://codeforces.com/problemset/problem/339/D 题目: A - Xenia and Bit Operations Time Lim...

codeforces 498 c Array and Operations

codeforces 498 c Array and Operations 题目链接 点击打开链接 题意:给出n个数a[1],a[2],...,a[n],给出m个数对(i,j)。对于每次操作,都先...

【网络流】 codeforces 498C Array and Operations

找出所有的因子跑最大流即可。。。当然本题还可以用二分匹配做。。。 #include #include #include #include #include #include #...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)