GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — OnJava8/docs/book/22-Enumerations.md at master · fondev/OnJava8

Expand file tree

/

22-Enumerations.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
62 lines (30 loc) · 934 Bytes
/

22-Enumerations.md

Copy path

File metadata and controls

62 lines (30 loc) · 934 Bytes
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

[TOC]

第二十二章 枚举

关键字enum可以将一组具名的值的有限集合创建为一种新的类型,而这些具名的值可以作为常规的程序组件使用。这是一种非常有用的功能

基本功能

方法添加

switch语句

values方法

实现而非继承

随机选择

使用接口组织

使用EnumSet替代Flags

使用EnumMap

常量特定方法

多次调度

本章小结

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.