mirror of
https://github.com/LingCoder/OnJava8.git
synced 2026-08-29 18:58:02 +08:00
62 lines
934 B
Markdown
62 lines
934 B
Markdown
[TOC]
|
||
|
||
<!-- Enumerations -->
|
||
# 第二十二章 枚举
|
||
|
||
> 关键字enum可以将一组具名的值的有限集合创建为一种新的类型,而这些具名的值可以作为常规的程序组件使用。这是一种非常有用的功能
|
||
|
||
|
||
|
||
<!-- Basic enum Features -->
|
||
|
||
## 基本功能
|
||
|
||
<!-- Adding Methods to an enum -->
|
||
|
||
## 方法添加
|
||
|
||
|
||
<!-- enums in switch Statements -->
|
||
## switch语句
|
||
|
||
|
||
<!-- The Mystery of values() -->
|
||
## values方法
|
||
|
||
|
||
<!-- Implements, not Inherits -->
|
||
## 实现而非继承
|
||
|
||
|
||
<!-- Random Selection -->
|
||
## 随机选择
|
||
|
||
|
||
<!-- Using Interfaces for Organization -->
|
||
## 使用接口组织
|
||
|
||
|
||
<!-- Using EnumSet Instead of Flags -->
|
||
## 使用EnumSet替代Flags
|
||
|
||
|
||
<!-- Using EnumMap -->
|
||
## 使用EnumMap
|
||
|
||
|
||
<!-- Constant-Specific Methods -->
|
||
## 常量特定方法
|
||
|
||
|
||
<!-- Multiple Dispatching -->
|
||
## 多次调度
|
||
|
||
|
||
<!-- Summary -->
|
||
## 本章小结
|
||
|
||
|
||
|
||
<!-- 分页 -->
|
||
|
||
<div style="page-break-after: always;"></div> |