阅读背景:

关于java基本数据类型中的枚举

来源:互联网 
<h2 style="box-sizing: border-box; font-family: Helvetica, 'Tahoma, Arial', sans-serif; font-weight: 400; line-height: 1.5em; margin: 0px 0px 5px; font-size: 18px; padding: 0px; background: none;">用法一:常量</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0.5em; padding-top: 0px; padding-bottom: 0px; line-height: 2; font-family: 'Microsoft Yahei'; font-size: 14px !important;">    在<span style="box-sizing: border-box; font-family: 'Times New Roman';">JDK1.5</span><span style="box-sizing: border-box;">之前,我们定义常量都是:</span><span style="box-sizing: border-box; font-family: 'Times New Roman';">publicstaticfianl....</span><span style="box-sizing: border-box;">。现在好了,有了枚举,可以把相关的常量分组到一个枚举类型里,而且枚举提供了比常量更多的方法。</span></p>public enum Color {<h2 style="box-sizing: border-box; font-family:



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: