`
heyJoe
  • 浏览: 27172 次
  • 性别: Icon_minigender_1
  • 来自: 西安
最近访客 更多访客>>
社区版块
存档分类
最新评论

Enumerated Type

 
阅读更多
这篇文章记录Java中枚举类型的特性


这一特性早在Java SE5的时候就存在了


参考书, Thinking In Java 4th Edition


先来看一段小的代码片段


[code="java"]enum Music {

        Pop, Jazz, Blues, Rock, Classic

}





分享到:
评论

相关推荐

    SystemVerilog for Design(2nd edition)

    这本书,超赞。强烈推荐!!!!!有很多很好的用例! Foreword ....................................................................................................................Preface ......................

    delphi2-delphi2010 全支持 dcu 装换 pas

    * Enumerated type, subrange of enumerated type and set of enumerated type For examples: type Size = (Small = 5, Medium = 10, Large = Small + Medium); TMySize = Medium..Large; type TEnumSet = ...

    resize_size_value.rar_Class Size

    every enumerator of every member of class T that is an enumerated type and struct X3.

    sliceslingmodel:JCR ORM 框架的比较

    Map JCR Primitives Yes Yes Map JCR Multi Properties Yes Yes Map Enumerated Type (from String property) Yes No Map Direct Child Model Yes Yes Map Collection of Child Models Yes No,会在 1.2.0 中吗?...

    win7下usb断电

    To apply the workaround globally for all enumerated USB devices, add a REG_DWORD value named DisableOnSoftRemove that has a value of 1 to the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\...

    javax.persistence.jar

    javax.persistence.Enumerated.class javax.persistence.EnumType.class javax.persistence.ExcludeDefaultListeners.class javax.persistence.ExcludeSuperclassListeners.class javax.persistence.FetchType.class...

    huhaihong2

    @Enumerated(EnumType.ORDINAL) public OpenModeEnum getOpenMode() { return openMode; } public void setOpenMode(OpenModeEnum openMode) { this.openMode = openMode; }

    Programming in Objective-C 4th Edition

    Enumerated Data Types 205 208 The typedef Statement Data Type Conversions 209 Conversion Rules 210 Bit Operators 211 The Bitwise AND Operator 212 The Bitwise Inclusive-OR Operator 213 The Bitwise ...

    LaTeX Beginner's Guide——Stefan Kottwitz

    5.Typeset professional-looking tables and create bulleted and enumerated lists 6.Write sophisticated math formulas, from in-text expressions to complex multi-line equations with various alignments 7....

    CLR via C# 第4版 英文PDF

    CHAPTER 15 Enumerated Types and Bit Flags 361 CHAPTER 16 Arrays 373 CHAPTER 17 Delegates 391 CHAPTER 18 Custom Attributes 421 CHAPTER 19 Nullable value Types 441 PART IV CORE FACILITIES CHAPTER 20 ...

    Device Console (DevCon) Tool_01_源码修正编译通过,VS2013可调试.rar

    For help with a specific command, type: devcon.exe help classfilter Add, delete, and reorder class filters. classes List all device setup classes. disable Disable devices. driverfiles List installed ...

    The C Cheat Sheet - An Introduction to Programming in C

    2.6 The void Type 3.0 Control Flow 3.1 The if/else/endif Statements 3.2 Compound Statements 3.3 Nested if Statements 3.4 The switch/case Statement 3.5 The for Statement 3.6 The while Statement 3.7...

    数位板压力测试

    sdk LCS/Telegraphics Wintab* Interface Specification 1.1: 16- and 32-bit API Reference By Rick Poyner Revised February 11, 2012 This specification was developed in response to a perceived need for a...

    xml入门教程/xml入门教程

    &2.DTD(Document Type Difinition DTD文档是用于规定XML文档的结构。只有结构符合所引用的DTD文件的XML文件才能称之为有效的XML文件。 DTD(文档类型定义) !DOCTYPE 定义DTD文件名 !ELEMENT 定义元素中可用的数据...

    zeratul:JPA的包装

    #Zeratul JPA的包装 ##用法 在您的项目中使用BaseModel和BaseDAO 创建模型时扩展BaseModel,例如: @Entity @Table(name = "my_model") ... @Enumerated(EnumType.STRING) @Column(name = "gen

    C标准库函数.CHM

    1.2.3 Enumerated Tags 1.2.4 Arrays 1.2.5 Structures and Unions 1.2.6 Constants 1.2.7 Strings 1.2.8 sizeof Keyword 1.3 Functions 1.3.1 Definition 1.3.2 Program Startup 1.4 References 1.4.1 ...

    weapp.qrcode.js

    // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call...

    Hibernate注释大全收藏

    @Enumerated(EnumType.STRING) Starred getNote() { ... } //enum persisted as String in database 上述代码中 counter, lengthInMeter 属性将忽略不被持久化,而 firstname, name, length 被定义为可持久化和可...

    Thinking in Java 4th Edition

    Enumerated types ............... 141 Summary ............................ 143 Access Control 145 package: the library unit ................... 146 Code organization ...................... 147 Creating...

    Go Programming

    3.5 The String Data Type .................................................. 63 3.5.1 The strings Package ............................................. 65 Prefixes and Suffixes ...........................

Global site tag (gtag.js) - Google Analytics