diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..2eb2ef8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,41 @@
+## 如何贡献项目
+
+领取或创建新的 [Issue](https://github.com/lingcoder/OnJava8/issues),如 [issue 14](https://github.com/lingcoder/OnJava8/issues/14) ,在编辑栏的右侧添加自己为 `Assignee`。
+
+在 [GitHub](https://github.com/lingcoder/OnJava8/fork) 上 `fork` 项目到自己的仓库,你的如 `user_name/OnJava8`,然后 `clone` 到本地,并设置用户信息。
+
+```bash
+$ git clone git@github.com:user_name/OnJava8.git
+
+$ cd OnJava8
+```
+
+修改代码后提交,并推送到自己的仓库,注意修改提交消息为对应 Issue 号和描述。
+
+```bash
+# 更新内容
+
+$ git commit -a -s
+
+# 在提交对话框里添加类似如下内容 "Fix issue #14: 描述你的修改内容"
+
+$ git push
+```
+
+在 [GitHub](https://github.com/lingcoder/OnJava8/pulls) 上提交 `Pull Request`,添加标签,并邀请维护者进行 `Review`。
+
+定期使用源项目仓库内容同步更新自己仓库的内容。
+
+```bash
+$ git remote add upstream https://github.com/lingcoder/OnJava8
+
+$ git fetch upstream
+
+$ git rebase upstream/master
+
+$ git push -f origin master
+```
+
+## 排版规范
+
+本开源书籍排版布局和翻译风格上参考**阮一峰**老师的 [中文技术文档的写作规范](https://github.com/ruanyf/document-style-guide)
diff --git a/README.md b/README.md
index d431fb1..bab1829 100644
--- a/README.md
+++ b/README.md
@@ -2,64 +2,87 @@
## 书籍简介
-* 本书原作者为 \[美\] [Bruce Eckel](https://github.com/BruceEckel),即(*Thinking in Java 4th Edition,2006*)的作者。
+* 本书原作者为 \[美\] *Bruce Eckel*,即(*Thinking in Java 4th Edition,2006*)的作者。
* 本书是事实上的 *Thinking in Java 5th Edition*(*On Java 8,2017*)。
-* *Thinking in Java 4th Edition*基于 **JAVA 5**版本;*On Java 8*基于**JAVA 8**版本。
+* *Thinking in Java 4th Edition* 基于 **JAVA 5** 版本;*On Java 8* 基于 **JAVA 8** 版本。
-## 快速阅读传送门
+## 传送门
-- GitHub 快速阅读:[进入目录](https://github.com/LingCoder/OnJava8/blob/master/SUMMARY.md)
+- 目录阅读:[进入](https://github.com/LingCoder/OnJava8/blob/master/SUMMARY.md)
-- Gitee 快速阅读:[进入目录](https://gitee.com/lingcoder/OnJava8/blob/master/SUMMARY.md)
+- GitHub Pages 完整阅读:[进入](https://lingcoder.github.io/OnJava8/)
-- GitBook 完整阅读:[进入Gitbook](https://lingcoder.gitbook.io/onjava8)
+- Gitee Pages 完整阅读:[进入](https://lingcoder.gitee.io/onjava8/)
## 翻译进度
-- [x] 前言
-- [x] 简介
-- [x] 第一章 对象的概念
-- [x] 第二章 安装Java和本书用例
-- [x] 第三章 万物皆对象
-- [ ] 第四章 运算符 (正在翻译中……)
-- [x] 第五章 控制流
-- [ ] 第六章 初始化和清理 (正在翻译中……)
-- [ ] 第七章 封装 (正在翻译中……)
-- [x] 第十三章 函数式编程
-- [x] 附录:新IO
-- [ ] 待续······
+- [x] [前言](docs/book/00-Preface.md)
+- [x] [简介](docs/book/00-Introduction.md)
+- [x] [第一章 对象的概念](docs/book/01-What-is-an-Object.md)
+- [x] [第二章 安装Java和本书用例](docs/book/02-Installing-Java-and-the-Book-Examples.md)
+- [x] [第三章 万物皆对象](docs/book/03-Objects-Everywhere.md)
+- [x] [第四章 运算符](docs/book/04-Operators.md)
+- [x] [第五章 控制流](docs/book/05-Control-Flow.md)
+- [ ] [第六章 初始化和清理](docs/book/06-Housekeeping.md) (正在翻译中……)
+- [ ] [第七章 封装](docs/book/07-Implementation-Hiding.md) (正在翻译中……)
+- [ ] [第八章 复用](docs/book/08-Reuse.md)
+- [ ] [第九章 多态](docs/book/09-Polymorphism.md)
+- [ ] [第十章 接口](docs/book/10-Interfaces.md)
+- [ ] [第十一章 内部类](docs/book/11-Inner-Classes.md)
+- [ ] [第十二章 集合](docs/book/12-Collections.md)
+- [x] [第十三章 函数式编程](docs/book/13-Functional-Programming.md)
+- [ ] [第十四章 流式编程](docs/book/14-Streams.md)
+- [ ] [第十五章 异常](docs/book/15-Exceptions.md)
+- [ ] [第十六章 代码校验](docs/book/16-Validating-Your-Code.md)
+- [ ] [第十七章 文件](docs/book/17-Files.md)
+- [ ] [第十八章 字符串](docs/book/18-Strings.md)
+- [ ] [第十九章 类型信息](docs/book/19-Type-Information.md)
+- [ ] [第二十章 泛型](docs/book/20-Generics.md)
+- [ ] [第二十一章 数组](docs/book/21-Arrays.md)
+- [ ] [第二十二章 枚举](docs/book/22-Enumerations.md)
+- [ ] [第二十三章 注解](docs/book/23-Annotations.md)
+- [ ] [第二十四章 并发编程](docs/book/24-Concurrent-Programming.md)
+- [ ] [第二十五章 设计模式](docs/book/25-Patterns.md)
+- [ ] [附录:补充](docs/book/Appendix-Supplements.md)
+- [ ] [附录:编程指南](docs/book/Appendix-Programming-Guidelines.md)
+- [ ] [附录:文档注释](docs/book/Appendix-Javadoc.md)
+- [ ] [附录:对象传递和返回](docs/book/Appendix-Passing-and-Returning-Objects.md)
+- [ ] [附录:流式IO](docs/book/Appendix-IO-Streams.md)
+- [ ] [附录:标准IO](docs/book/Appendix-Standard-IO.md)
+- [x] [附录:新IO](docs/book/Appendix-New-IO.md)
+- [ ] [附录:理解equals和hashCode方法](docs/book/Appendix-Understanding-equals-and-hashCode.md)
+
+- [ ] [附录:集合主题](docs/book/Appendix-Collection-Topics.md)
+
+- [ ] [附录:并发底层原理](docs/book/Appendix-Low-Level-Concurrency.md)
+
+- [ ] [附录:数据压缩](docs/book/Appendix-Data-Compression.md)
+
+- [ ] [附录:对象序列化](docs/book/Appendix-Object-Serialization.md)
+
+- [ ] [附录:静态语言类型检查](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md)
+
+- [ ] [附录:成为一名程序员](docs/book/Appendix-Becoming-a-Programmer.md)
+
## 一起交流
-交流群:721698221
( 点击图标即可加入 )
+交流群:721698221
( 点击图标即可加入 )
+
@@ -67,17 +90,19 @@
* 作者: Bruce Eckel
* ISBN: 9780981872520
+* 页数:2038
+* 发行:仅电子版
## 贡献者
-* 主译: LingCoder,LortSir
-* 参译:
-* 校对:nickChenyx
+* 主译: [LingCoder](https://github.com/LingCoder)
+* 参译: [LortSir](https://github.com/LortSir)
+* 校对:[nickChenyx](https://github.com/nickChenyx)
## 翻译说明
-1. 本书排版布局和翻译风格上参考了**阮一峰**老师的[中文技术文档的写作规范](https://github.com/ruanyf/document-style-guide)
+1. 本书排版布局和翻译风格上参考**阮一峰**老师的 [中文技术文档的写作规范](https://github.com/ruanyf/document-style-guide)
2. 采用第一人称叙述。
3. 由于中英行文差异,完全的逐字逐句翻译会很冗余啰嗦。所以本人在翻译过程中,去除了部分主题无关内容、重复描写。
4. 译者在翻译中同时参考了谷歌、百度、有道翻译的译文以及《Java编程思想》第四版中文版的部分内容(对其翻译死板,生造名词,语言精炼度差问题进行规避和改正)。最后结合译者自己的理解进行本地化,尽量做到专业和言简意赅,方便大家更好的理解学习。
@@ -92,9 +117,9 @@
可以把一些不尽人意的语句翻译的更好更有趣
对于以上各类建议,请以 issue 或 pr 的形式发送,我看到之后会尽快处理
使用 MarkDown 编辑器,md 语法格式进行文档翻译及排版工作
-完成之后 Pull Request
+完成之后 PullRequest
如没问题的话,我会合并到主分支
-如果不太明白 md 的排版,可以不必太过纠结,我会在合并提交时代为排版
+如不熟悉 md 排版,可不必纠结,我会在合并 pr 时代为排版
如还有其它问题,欢迎发送 issue,谢谢~
diff --git a/SUMMARY.md b/SUMMARY.md
index 4f3d69a..14a1089 100644
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -1,418 +1,414 @@
# Summary
* [Introduction](README.md)
-* [译者的话](Introduction.md)
-* [封面](book/00-On-Java-8.md)
-* [前言](book/00-Preface.md)
- * [教学目标](book/00-Preface.md#教学目标)
- * [语言设计错误](book/00-Preface.md#语言设计错误)
- * [测试用例](book/00-Preface.md#测试用例)
- * [普及性](book/00-Preface.md#普及性)
- * [关于安卓](book/00-Preface.md#关于安卓)
- * [电子版权声明](book/00-Preface.md#电子版权声明)
- * [版本说明](book/00-Preface.md#版本说明)
- * [封面设计](book/00-Preface.md#封面设计)
- * [感谢的人](book/00-Preface.md#感谢的人)
- * [献礼](book/00-Preface.md#献礼)
-* [简介](book/00-Introduction.md)
- * [前提条件](book/00-Introduction.md#前提条件)
- * [JDK文档](book/00-Introduction.md#JDK文档)
- * [C编程思想](book/00-Introduction.md#C编程思想)
- * [源码下载](book/00-Introduction.md#源码下载)
- * [编码样式](book/00-Introduction.md#编码样式)
- * [BUG提交](book/00-Introduction.md#BUG提交)
- * [邮箱订阅](book/00-Introduction.md#邮箱订阅)
- * [Java图形界面](book/00-Introduction.md#Java图形界面)
+* [译者的话](docs/README.md)
+* [封面](docs/book/00-On-Java-8.md)
+* [前言](docs/book/00-Preface.md)
+ * [教学目标](docs/book/00-Preface.md#教学目标)
+ * [语言设计错误](docs/book/00-Preface.md#语言设计错误)
+ * [测试用例](docs/book/00-Preface.md#测试用例)
+ * [普及性](docs/book/00-Preface.md#普及性)
+ * [关于安卓](docs/book/00-Preface.md#关于安卓)
+ * [电子版权声明](docs/book/00-Preface.md#电子版权声明)
+ * [版本说明](docs/book/00-Preface.md#版本说明)
+ * [封面设计](docs/book/00-Preface.md#封面设计)
+ * [感谢的人](docs/book/00-Preface.md#感谢的人)
+ * [献礼](docs/book/00-Preface.md#献礼)
+* [简介](docs/book/00-Introduction.md)
+ * [前提条件](docs/book/00-Introduction.md#前提条件)
+ * [JDK文档](docs/book/00-Introduction.md#JDK文档)
+ * [C编程思想](docs/book/00-Introduction.md#C编程思想)
+ * [源码下载](docs/book/00-Introduction.md#源码下载)
+ * [编码样式](docs/book/00-Introduction.md#编码样式)
+ * [BUG提交](docs/book/00-Introduction.md#BUG提交)
+ * [邮箱订阅](docs/book/00-Introduction.md#邮箱订阅)
+ * [Java图形界面](docs/book/00-Introduction.md#Java图形界面)
-### 正文
+* [第一章 对象的概念](docs/book/01-What-is-an-Object.md)
+ * [抽象](docs/book/01-What-is-an-Object.md#抽象)
+ * [接口](docs/book/01-What-is-an-Object.md#接口)
+ * [服务提供](docs/book/01-What-is-an-Object.md#服务提供)
+ * [封装](docs/book/01-What-is-an-Object.md#封装)
+ * [复用](docs/book/01-What-is-an-Object.md#复用)
+ * [继承](docs/book/01-What-is-an-Object.md#继承)
+ * [多态](docs/book/01-What-is-an-Object.md#多态)
+ * [单继承](docs/book/01-What-is-an-Object.md#单继承)
+ * [集合](docs/book/01-What-is-an-Object.md#集合)
+ * [生命周期](docs/book/01-What-is-an-Object.md#生命周期)
+ * [异常处理](docs/book/01-What-is-an-Object.md#异常处理)
+ * [本章小结](docs/book/01-What-is-an-Object.md#本章小结)
+* [第二章 安装Java和本书用例](docs/book/02-Installing-Java-and-the-Book-Examples.md)
+ * [编辑器](docs/book/02-Installing-Java-and-the-Book-Examples.md#编辑器)
+ * [Shell](docs/book/02-Installing-Java-and-the-Book-Examples.md#Shell)
+ * [Java安装](docs/book/02-Installing-Java-and-the-Book-Examples.md#Java安装)
+ * [校验安装](docs/book/02-Installing-Java-and-the-Book-Examples.md#校验安装)
+ * [安装和运行代码示例](docs/book/02-Installing-Java-and-the-Book-Examples.md#安装和运行代码示例)
+* [第三章 万物皆对象](docs/book/03-Objects-Everywhere.md)
+ * [对象操纵](docs/book/03-Objects-Everywhere.md#对象操纵)
+ * [对象创建](docs/book/03-Objects-Everywhere.md#对象创建)
+ * [代码注释](docs/book/03-Objects-Everywhere.md#代码注释)
+ * [对象清理](docs/book/03-Objects-Everywhere.md#对象清理)
+ * [类的创建](docs/book/03-Objects-Everywhere.md#类的创建)
+ * [程序编写](docs/book/03-Objects-Everywhere.md#程序编写)
+ * [小试牛刀](docs/book/03-Objects-Everywhere.md#小试牛刀)
+ * [编码风格](docs/book/03-Objects-Everywhere.md#编码风格)
+ * [本章小结](docs/book/03-Objects-Everywhere.md#本章小结)
+* [第四章 运算符](docs/book/04-Operators.md)
+ * [使用说明](docs/book/04-Operators.md#使用说明)
+ * [优先级](docs/book/04-Operators.md#优先级)
+ * [赋值](docs/book/04-Operators.md#赋值)
+ * [算术运算符](docs/book/04-Operators.md#算术运算符)
+ * [递增和递减](docs/book/04-Operators.md#递增和递减)
+ * [关系运算符](docs/book/04-Operators.md#关系运算符)
+ * [逻辑运算符](docs/book/04-Operators.md#逻辑运算符)
+ * [字面值常量](docs/book/04-Operators.md#字面值常量)
+ * [按位运算符](docs/book/04-Operators.md#按位运算符)
+ * [移位运算符](docs/book/04-Operators.md#移位运算符)
+ * [三元运算符](docs/book/04-Operators.md#三元运算符)
+ * [字符串运算符](docs/book/04-Operators.md#字符串运算符)
+ * [常见陷阱](docs/book/04-Operators.md#常见陷阱)
+ * [类型转换](docs/book/04-Operators.md#类型转换)
+ * [Java没有sizeof](docs/book/04-Operators.md#Java没有sizeof)
+ * [运算符总结](docs/book/04-Operators.md#运算符总结)
+ * [本章小结](docs/book/04-Operators.md#本章小结)
+* [第五章 控制流](docs/book/05-Control-Flow.md)
+ * [true和flase](docs/book/05-Control-Flow.md#true和flase)
+ * [if-else](docs/book/05-Control-Flow.md#if-else)
+ * [迭代语句](docs/book/05-Control-Flow.md#迭代语句)
+ * [for-in语法](docs/book/05-Control-Flow.md#for-in语法)
+ * [return](docs/book/05-Control-Flow.md#return)
+ * [break和continue](docs/book/05-Control-Flow.md#break和continue)
+ * [臭名昭著的goto](docs/book/05-Control-Flow.md#臭名昭著的goto)
+ * [switch](docs/book/05-Control-Flow.md#switch)
+ * [switch字符串](docs/book/05-Control-Flow.md#switch字符串)
+ * [本章小结](docs/book/05-Control-Flow.md#本章小结)
+* [第六章 初始化和清理](docs/book/06-Housekeeping.md)
+ * [利用构造器保证初始化](docs/book/06-Housekeeping.md#利用构造器保证初始化)
+ * [方法重载](docs/book/06-Housekeeping.md#方法重载)
+ * [无参构造器](docs/book/06-Housekeeping.md#无参构造器)
+ * [this关键字](docs/book/06-Housekeeping.md#this关键字)
+ * [垃圾回收器](docs/book/06-Housekeeping.md#垃圾回收器)
+ * [成员初始化](docs/book/06-Housekeeping.md#成员初始化)
+ * [构造器初始化](docs/book/06-Housekeeping.md#构造器初始化)
+ * [数组初始化](docs/book/06-Housekeeping.md#数组初始化)
+ * [枚举类型](docs/book/06-Housekeeping.md#枚举类型)
+ * [本章小结](docs/book/06-Housekeeping.md#本章小结)
+* [第七章 封装](docs/book/07-Implementation-Hiding.md)
+ * [包的概念](docs/book/07-Implementation-Hiding.md#包的概念)
+ * [访问权限修饰符](docs/book/07-Implementation-Hiding.md#访问权限修饰符)
+ * [接口和实现](docs/book/07-Implementation-Hiding.md#接口和实现)
+ * [类访问权限](docs/book/07-Implementation-Hiding.md#类访问权限)
+ * [本章小结](docs/book/07-Implementation-Hiding.md#本章小结)
+* [第八章 复用](docs/book/08-Reuse.md)
+ * [组合语法](docs/book/08-Reuse.md#组合语法)
+ * [继承语法](docs/book/08-Reuse.md#继承语法)
+ * [委托](docs/book/08-Reuse.md#委托)
+ * [结合组合与继承](docs/book/08-Reuse.md#结合组合与继承)
+ * [组合与继承的选择](docs/book/08-Reuse.md#组合与继承的选择)
+ * [protected](docs/book/08-Reuse.md#protected)
+ * [向上转型](docs/book/08-Reuse.md#向上转型)
+ * [final关键字](docs/book/08-Reuse.md#final关键字)
+ * [类初始化和加载](docs/book/08-Reuse.md#类初始化和加载)
+ * [本章小结](docs/book/08-Reuse.md#本章小结)
+* [第九章 多态](docs/book/09-Polymorphism.md)
+ * [向上转型回溯](docs/book/09-Polymorphism.md#向上转型回溯)
+ * [深入理解](docs/book/09-Polymorphism.md#深入理解)
+ * [构造器和多态](docs/book/09-Polymorphism.md#构造器和多态)
+ * [返回类型协变](docs/book/09-Polymorphism.md#返回类型协变)
+ * [使用继承设计](docs/book/09-Polymorphism.md#使用继承设计)
+ * [本章小结](docs/book/09-Polymorphism.md#本章小结)
+* [第十章 接口](docs/book/10-Interfaces.md)
+ * [抽象类和方法](docs/book/10-Interfaces.md#抽象类和方法)
+ * [接口创建](docs/book/10-Interfaces.md#接口创建)
+ * [抽象类和接口](docs/book/10-Interfaces.md#抽象类和接口)
+ * [完全解耦](docs/book/10-Interfaces.md#完全解耦)
+ * [多接口结合](docs/book/10-Interfaces.md#多接口结合)
+ * [使用继承扩展接口](docs/book/10-Interfaces.md#使用继承扩展接口)
+ * [接口适配](docs/book/10-Interfaces.md#接口适配)
+ * [接口字段](docs/book/10-Interfaces.md#接口字段)
+ * [接口嵌套](docs/book/10-Interfaces.md#接口嵌套)
+ * [接口和工厂方法模式](docs/book/10-Interfaces.md#接口和工厂方法模式)
+ * [本章小结](docs/book/10-Interfaces.md#本章小结)
+* [第十一章 内部类](docs/book/11-Inner-Classes.md)
+ * [创建内部类](docs/book/11-Inner-Classes.md#创建内部类)
+ * [链接外部类](docs/book/11-Inner-Classes.md#链接外部类)
+ * [内部类this和new的使用](docs/book/11-Inner-Classes.md#内部类this和new的使用)
+ * [内部类向上转型](docs/book/11-Inner-Classes.md#内部类向上转型)
+ * [内部类方法和作用域](docs/book/11-Inner-Classes.md#内部类方法和作用域)
+ * [匿名内部类](docs/book/11-Inner-Classes.md#匿名内部类)
+ * [嵌套类](docs/book/11-Inner-Classes.md#嵌套类)
+ * [内部类应用场景](docs/book/11-Inner-Classes.md#内部类应用场景)
+ * [继承内部类](docs/book/11-Inner-Classes.md#继承内部类)
+ * [重写内部类](docs/book/11-Inner-Classes.md#重写内部类)
+ * [内部类局部变量](docs/book/11-Inner-Classes.md#内部类局部变量)
+ * [内部类标识符](docs/book/11-Inner-Classes.md#内部类标识符)
+ * [本章小结](docs/book/11-Inner-Classes.md#本章小结)
+* [第十二章 集合](docs/book/12-Collections.md)
+ * [泛型和类型安全的集合](docs/book/12-Collections.md#泛型和类型安全的集合)
+ * [基本概念](docs/book/12-Collections.md#基本概念)
+ * [添加元素组](docs/book/12-Collections.md#添加元素组)
+ * [集合的打印](docs/book/12-Collections.md#集合的打印)
+ * [列表List](docs/book/12-Collections.md#列表List)
+ * [迭代器Iterators](docs/book/12-Collections.md#迭代器Iterators)
+ * [链表LinkedList](docs/book/12-Collections.md#链表LinkedList)
+ * [堆栈Stack](docs/book/12-Collections.md#堆栈Stack)
+ * [集合Set](docs/book/12-Collections.md#集合Set)
+ * [映射Map](docs/book/12-Collections.md#映射Map)
+ * [队列Queue](docs/book/12-Collections.md#队列Queue)
+ * [集合与迭代器](docs/book/12-Collections.md#集合与迭代器)
+ * [for-in和迭代器](docs/book/12-Collections.md#for-in和迭代器)
+ * [本章小结](docs/book/12-Collections.md#本章小结)
+* [第十三章 函数式编程](docs/book/13-Functional-Programming.md)
+ * [旧vs新](docs/book/13-Functional-Programming.md#旧vs新)
+ * [Lambda表达式](docs/book/13-Functional-Programming.md#Lambda表达式)
+ * [方法引用](docs/book/13-Functional-Programming.md#方法引用)
+ * [函数式接口](docs/book/13-Functional-Programming.md#函数式接口)
+ * [高阶函数](docs/book/13-Functional-Programming.md#高阶函数)
+ * [闭包](docs/book/13-Functional-Programming.md#闭包)
+ * [函数组合](docs/book/13-Functional-Programming.md#函数组合)
+ * [Currying和Partial-Evaluation](docs/book/13-Functional-Programming.md#Currying和Partial-Evaluation)
+ * [纯函数式编程](docs/book/13-Functional-Programming.md#纯函数式编程)
+ * [本章小结](docs/book/13-Functional-Programming.md#本章小结)
+* [第十四章 流式编程](docs/book/14-Streams.md)
+ * [流支持](docs/book/14-Streams.md#流支持)
+ * [流创建](docs/book/14-Streams.md#流创建)
+ * [中级流操作](docs/book/14-Streams.md#中级流操作)
+ * [Optional类](docs/book/14-Streams.md#Optional类)
+ * [终端操作](docs/book/14-Streams.md#终端操作)
+ * [本章小结](docs/book/14-Streams.md#本章小结)
+* [第十五章 异常](docs/book/15-Exceptions.md)
+ * [异常概念](docs/book/15-Exceptions.md#异常概念)
+ * [基本异常](docs/book/15-Exceptions.md#基本异常)
+ * [异常捕获](docs/book/15-Exceptions.md#异常捕获)
+ * [自定义异常](docs/book/15-Exceptions.md#自定义异常)
+ * [异常规范](docs/book/15-Exceptions.md#异常规范)
+ * [任意异常捕获](docs/book/15-Exceptions.md#任意异常捕获)
+ * [Java标准异常](docs/book/15-Exceptions.md#Java标准异常)
+ * [finally关键字](docs/book/15-Exceptions.md#finally关键字)
+ * [异常限制](docs/book/15-Exceptions.md#异常限制)
+ * [异常构造](docs/book/15-Exceptions.md#异常构造)
+ * [Try-With-Resources用法](docs/book/15-Exceptions.md#Try-With-Resources用法)
+ * [异常匹配](docs/book/15-Exceptions.md#异常匹配)
+ * [异常准则](docs/book/15-Exceptions.md#异常准则)
+ * [异常指南](docs/book/15-Exceptions.md#异常指南)
+ * [本章小结](docs/book/15-Exceptions.md#本章小结)
+* [第十六章 代码校验](docs/book/16-Validating-Your-Code.md)
+ * [测试](docs/book/16-Validating-Your-Code.md#测试)
+ * [前提条件](docs/book/16-Validating-Your-Code.md#前提条件)
+ * [测试驱动开发](docs/book/16-Validating-Your-Code.md#测试驱动开发)
+ * [日志](docs/book/16-Validating-Your-Code.md#日志)
+ * [调试](docs/book/16-Validating-Your-Code.md#调试)
+ * [基准测试](docs/book/16-Validating-Your-Code.md#基准测试)
+ * [分析和优化](docs/book/16-Validating-Your-Code.md#分析和优化)
+ * [风格检测](docs/book/16-Validating-Your-Code.md#风格检测)
+ * [静态错误分析](docs/book/16-Validating-Your-Code.md#静态错误分析)
+ * [代码重审](docs/book/16-Validating-Your-Code.md#代码重审)
+ * [结对编程](docs/book/16-Validating-Your-Code.md#结对编程)
+ * [重构](docs/book/16-Validating-Your-Code.md#重构)
+ * [持续集成](docs/book/16-Validating-Your-Code.md#持续集成)
+ * [本章小结](docs/book/16-Validating-Your-Code.md#本章小结)
+* [第十七章 文件](docs/book/17-Files.md)
+ * [文件和目录路径](docs/book/17-Files.md#文件和目录路径)
+ * [目录](docs/book/17-Files.md#目录)
+ * [文件系统](docs/book/17-Files.md#文件系统)
+ * [路径监听](docs/book/17-Files.md#路径监听)
+ * [文件查找](docs/book/17-Files.md#文件查找)
+ * [文件读写](docs/book/17-Files.md#文件读写)
+ * [本章小结](docs/book/17-Files.md#本章小结)
+* [第十八章 字符串](docs/book/18-Strings.md)
+ * [字符串的不可变](docs/book/18-Strings.md#字符串的不可变)
+ * [重载和StringBuilder](docs/book/18-Strings.md#重载和StringBuilder)
+ * [意外递归](docs/book/18-Strings.md#意外递归)
+ * [字符串操作](docs/book/18-Strings.md#字符串操作)
+ * [格式化输出](docs/book/18-Strings.md#格式化输出)
+ * [常规表达式](docs/book/18-Strings.md#常规表达式)
+ * [扫描输入](docs/book/18-Strings.md#扫描输入)
+ * [StringTokenizer类](docs/book/18-Strings.md#StringTokenizer类)
+ * [本章小结](docs/book/18-Strings.md#本章小结)
+* [第十九章 类型信息](docs/book/19-Type-Information.md)
+ * [运行时类型信息](docs/book/19-Type-Information.md#运行时类型信息)
+ * [类的对象](docs/book/19-Type-Information.md#类的对象)
+ * [类型转换检测](docs/book/19-Type-Information.md#类型转换检测)
+ * [注册工厂](docs/book/19-Type-Information.md#注册工厂)
+ * [类的等价比较](docs/book/19-Type-Information.md#类的等价比较)
+ * [反射运行时类信息](docs/book/19-Type-Information.md#反射运行时类信息)
+ * [动态代理](docs/book/19-Type-Information.md#动态代理)
+ * [Optional类](docs/book/19-Type-Information.md#Optional类)
+ * [接口和类型](docs/book/19-Type-Information.md#接口和类型)
+ * [本章小结](docs/book/19-Type-Information.md#本章小结)
+* [第二十章 泛型](docs/book/20-Generics.md)
+ * [简单泛型](docs/book/20-Generics.md#简单泛型)
+ * [泛型接口](docs/book/20-Generics.md#泛型接口)
+ * [泛型方法](docs/book/20-Generics.md#泛型方法)
+ * [复杂模型构建](docs/book/20-Generics.md#复杂模型构建)
+ * [泛型擦除](docs/book/20-Generics.md#泛型擦除)
+ * [补偿擦除](docs/book/20-Generics.md#补偿擦除)
+ * [边界](docs/book/20-Generics.md#边界)
+ * [通配符](docs/book/20-Generics.md#通配符)
+ * [问题](docs/book/20-Generics.md#问题)
+ * [自我约束类型](docs/book/20-Generics.md#自我约束类型)
+ * [动态类型安全](docs/book/20-Generics.md#动态类型安全)
+ * [泛型异常](docs/book/20-Generics.md#泛型异常)
+ * [混入](docs/book/20-Generics.md#混入)
+ * [潜在类型](docs/book/20-Generics.md#潜在类型)
+ * [补偿不足](docs/book/20-Generics.md#补偿不足)
+ * [辅助潜在类型](docs/book/20-Generics.md#辅助潜在类型)
+ * [泛型的优劣](docs/book/20-Generics.md#泛型的优劣)
+* [第二十一章 数组](docs/book/21-Arrays.md)
+ * [数组特性](docs/book/21-Arrays.md#数组特性)
+ * [一等对象](docs/book/21-Arrays.md#一等对象)
+ * [返回数组](docs/book/21-Arrays.md#返回数组)
+ * [多维数组](docs/book/21-Arrays.md#多维数组)
+ * [泛型数组](docs/book/21-Arrays.md#泛型数组)
+ * [Arrays的fill方法](docs/book/21-Arrays.md#Arrays的fill方法)
+ * [Arrays的setAll方法](docs/book/21-Arrays.md#Arrays的setAll方法)
+ * [增量生成](docs/book/21-Arrays.md#增量生成)
+ * [随机生成](docs/book/21-Arrays.md#随机生成)
+ * [泛型和基本数组](docs/book/21-Arrays.md#泛型和基本数组)
+ * [数组元素修改](docs/book/21-Arrays.md#数组元素修改)
+ * [数组并行](docs/book/21-Arrays.md#数组并行)
+ * [Arrays工具类](docs/book/21-Arrays.md#Arrays工具类)
+ * [数组拷贝](docs/book/21-Arrays.md#数组拷贝)
+ * [数组比较](docs/book/21-Arrays.md#数组比较)
+ * [流和数组](docs/book/21-Arrays.md#流和数组)
+ * [数组排序](docs/book/21-Arrays.md#数组排序)
+ * [binarySearch二分查找](docs/book/21-Arrays.md#binarySearch二分查找)
+ * [parallelPrefix并行前缀](docs/book/21-Arrays.md#parallelPrefix并行前缀)
+ * [本章小结](docs/book/21-Arrays.md#本章小结)
+* [第二十二章 枚举](docs/book/22-Enumerations.md)
+ * [基本功能](docs/book/22-Enumerations.md#基本功能)
+ * [方法添加](docs/book/22-Enumerations.md#方法添加)
+ * [switch语句](docs/book/22-Enumerations.md#switch语句)
+ * [values方法](docs/book/22-Enumerations.md#values方法)
+ * [实现而非继承](docs/book/22-Enumerations.md#实现而非继承)
+ * [随机选择](docs/book/22-Enumerations.md#随机选择)
+ * [使用接口组织](docs/book/22-Enumerations.md#使用接口组织)
+ * [使用EnumSet替代Flags](docs/book/22-Enumerations.md#使用EnumSet替代Flags)
+ * [使用EnumMap](docs/book/22-Enumerations.md#使用EnumMap)
+ * [常量特定方法](docs/book/22-Enumerations.md#常量特定方法)
+ * [多次调度](docs/book/22-Enumerations.md#多次调度)
+ * [本章小结](docs/book/22-Enumerations.md#本章小结)
+* [第二十三章 注解](docs/book/23-Annotations.md)
+ * [基本语法](docs/book/23-Annotations.md#基本语法)
+ * [编写注解处理器](docs/book/23-Annotations.md#编写注解处理器)
+ * [使用javac处理注解](docs/book/23-Annotations.md#使用javac处理注解)
+ * [基于注解的单元测试](docs/book/23-Annotations.md#基于注解的单元测试)
+ * [本章小结](docs/book/23-Annotations.md#本章小结)
+* [第二十四章 并发编程](docs/book/24-Concurrent-Programming.md)
+ * [术语问题](docs/book/24-Concurrent-Programming.md#术语问题)
+ * [并发的超能力](docs/book/24-Concurrent-Programming.md#并发的超能力)
+ * [针对速度](docs/book/24-Concurrent-Programming.md#针对速度)
+ * [四句格言](docs/book/24-Concurrent-Programming.md#四句格言)
+ * [残酷的真相](docs/book/24-Concurrent-Programming.md#残酷的真相)
+ * [本章其余部分](docs/book/24-Concurrent-Programming.md#本章其余部分)
+ * [并行流](docs/book/24-Concurrent-Programming.md#并行流)
+ * [创建和运行任务](docs/book/24-Concurrent-Programming.md#创建和运行任务)
+ * [终止耗时任务](docs/book/24-Concurrent-Programming.md#终止耗时任务)
+ * [CompletableFuture类](docs/book/24-Concurrent-Programming.md#CompletableFuture类)
+ * [死锁](docs/book/24-Concurrent-Programming.md#死锁)
+ * [构造函数非线程安全](docs/book/24-Concurrent-Programming.md#构造函数非线程安全)
+ * [复杂性和代价](docs/book/24-Concurrent-Programming.md#复杂性和代价)
+ * [本章小结](docs/book/24-Concurrent-Programming.md#本章小结)
+* [第二十五章 设计模式](docs/book/25-Patterns.md)
+ * [概念](docs/book/25-Patterns.md#概念)
+ * [构建型](docs/book/25-Patterns.md#构建型)
+ * [面向实施](docs/book/25-Patterns.md#面向实施)
+ * [工厂模式](docs/book/25-Patterns.md#工厂模式)
+ * [函数对象](docs/book/25-Patterns.md#函数对象)
+ * [接口改变](docs/book/25-Patterns.md#接口改变)
+ * [解释器](docs/book/25-Patterns.md#解释器)
+ * [回调](docs/book/25-Patterns.md#回调)
+ * [多次调度](docs/book/25-Patterns.md#多次调度)
+ * [模式重构](docs/book/25-Patterns.md#模式重构)
+ * [抽象用法](docs/book/25-Patterns.md#抽象用法)
+ * [多次派遣](docs/book/25-Patterns.md#多次派遣)
+ * [访问者模式](docs/book/25-Patterns.md#访问者模式)
+ * [RTTI的优劣](docs/book/25-Patterns.md#RTTI的优劣)
+ * [本章小结](docs/book/25-Patterns.md#本章小结)
-* [第一章 对象的概念](book/01-What-is-an-Object.md)
- * [抽象](book/01-What-is-an-Object.md#抽象)
- * [接口](book/01-What-is-an-Object.md#接口)
- * [服务提供](book/01-What-is-an-Object.md#服务提供)
- * [封装](book/01-What-is-an-Object.md#封装)
- * [复用](book/01-What-is-an-Object.md#复用)
- * [继承](book/01-What-is-an-Object.md#继承)
- * [多态](book/01-What-is-an-Object.md#多态)
- * [单继承](book/01-What-is-an-Object.md#单继承)
- * [集合](book/01-What-is-an-Object.md#集合)
- * [生命周期](book/01-What-is-an-Object.md#生命周期)
- * [异常处理](book/01-What-is-an-Object.md#异常处理)
- * [本章小结](book/01-What-is-an-Object.md#本章小结)
-* [第二章 安装Java和本书用例](book/02-Installing-Java-and-the-Book-Examples.md)
- * [编辑器](book/02-Installing-Java-and-the-Book-Examples.md#编辑器)
- * [Shell](book/02-Installing-Java-and-the-Book-Examples.md#Shell)
- * [Java安装](book/02-Installing-Java-and-the-Book-Examples.md#Java安装)
- * [校验安装](book/02-Installing-Java-and-the-Book-Examples.md#校验安装)
- * [安装和运行代码示例](book/02-Installing-Java-and-the-Book-Examples.md#安装和运行代码示例)
-* [第三章 万物皆对象](book/03-Objects-Everywhere.md)
- * [对象操纵](book/03-Objects-Everywhere.md#对象操纵)
- * [对象创建](book/03-Objects-Everywhere.md#对象创建)
- * [代码注释](book/03-Objects-Everywhere.md#代码注释)
- * [对象清理](book/03-Objects-Everywhere.md#对象清理)
- * [类的创建](book/03-Objects-Everywhere.md#类的创建)
- * [程序编写](book/03-Objects-Everywhere.md#程序编写)
- * [小试牛刀](book/03-Objects-Everywhere.md#小试牛刀)
- * [编码风格](book/03-Objects-Everywhere.md#编码风格)
- * [本章小结](book/03-Objects-Everywhere.md#本章小结)
-* [第四章 运算符](book/04-Operators.md)
- * [使用说明](book/04-Operators.md#使用说明)
- * [优先级](book/04-Operators.md#优先级)
- * [赋值](book/04-Operators.md#赋值)
- * [算术运算符](book/04-Operators.md#算术运算符)
- * [递增和递减](book/04-Operators.md#递增和递减)
- * [关系运算符](book/04-Operators.md#关系运算符)
- * [逻辑运算符](book/04-Operators.md#逻辑运算符)
- * [字面值常量](book/04-Operators.md#字面值常量)
- * [按位运算符](book/04-Operators.md#按位运算符)
- * [移位运算符](book/04-Operators.md#移位运算符)
- * [三元运算符](book/04-Operators.md#三元运算符)
- * [字符串运算符](book/04-Operators.md#字符串运算符)
- * [常见陷阱](book/04-Operators.md#常见陷阱)
- * [类型转换](book/04-Operators.md#类型转换)
- * [Java没有sizeof](book/04-Operators.md#Java没有sizeof)
- * [运算符总结](book/04-Operators.md#运算符总结)
- * [本章小结](book/04-Operators.md#本章小结)
-* [第五章 控制流](book/05-Control-Flow.md)
- * [true和flase](book/05-Control-Flow.md#true和flase)
- * [if-else](book/05-Control-Flow.md#if-else)
- * [迭代语句](book/05-Control-Flow.md#迭代语句)
- * [for-in语法](book/05-Control-Flow.md#for-in语法)
- * [return](book/05-Control-Flow.md#return)
- * [break和continue](book/05-Control-Flow.md#break和continue)
- * [臭名昭著的goto](book/05-Control-Flow.md#臭名昭著的goto)
- * [switch](book/05-Control-Flow.md#switch)
- * [switch字符串](book/05-Control-Flow.md#switch字符串)
- * [本章小结](book/05-Control-Flow.md#本章小结)
-* [第六章 初始化和清理](book/06-Housekeeping.md)
- * [利用构造器保证初始化](book/06-Housekeeping.md#利用构造器保证初始化)
- * [方法重载](book/06-Housekeeping.md#方法重载)
- * [无参构造器](book/06-Housekeeping.md#无参构造器)
- * [this关键字](book/06-Housekeeping.md#this关键字)
- * [垃圾回收器](book/06-Housekeeping.md#垃圾回收器)
- * [成员初始化](book/06-Housekeeping.md#成员初始化)
- * [构造器初始化](book/06-Housekeeping.md#构造器初始化)
- * [数组初始化](book/06-Housekeeping.md#数组初始化)
- * [枚举类型](book/06-Housekeeping.md#枚举类型)
- * [本章小结](book/06-Housekeeping.md#本章小结)
-* [第七章 封装](book/07-Implementation-Hiding.md)
- * [包的概念](book/07-Implementation-Hiding.md#包的概念)
- * [访问权限修饰符](book/07-Implementation-Hiding.md#访问权限修饰符)
- * [接口和实现](book/07-Implementation-Hiding.md#接口和实现)
- * [类访问权限](book/07-Implementation-Hiding.md#类访问权限)
- * [本章小结](book/07-Implementation-Hiding.md#本章小结)
-* [第八章 复用](book/08-Reuse.md)
- * [组合语法](book/08-Reuse.md#组合语法)
- * [继承语法](book/08-Reuse.md#继承语法)
- * [委托](book/08-Reuse.md#委托)
- * [结合组合与继承](book/08-Reuse.md#结合组合与继承)
- * [组合与继承的选择](book/08-Reuse.md#组合与继承的选择)
- * [protected](book/08-Reuse.md#protected)
- * [向上转型](book/08-Reuse.md#向上转型)
- * [final关键字](book/08-Reuse.md#final关键字)
- * [类初始化和加载](book/08-Reuse.md#类初始化和加载)
- * [本章小结](book/08-Reuse.md#本章小结)
-* [第九章 多态](book/09-Polymorphism.md)
- * [向上转型回溯](book/09-Polymorphism.md#向上转型回溯)
- * [深入理解](book/09-Polymorphism.md#深入理解)
- * [构造器和多态](book/09-Polymorphism.md#构造器和多态)
- * [返回类型协变](book/09-Polymorphism.md#返回类型协变)
- * [使用继承设计](book/09-Polymorphism.md#使用继承设计)
- * [本章小结](book/09-Polymorphism.md#本章小结)
-* [第十章 接口](book/10-Interfaces.md)
- * [抽象类和方法](book/10-Interfaces.md#抽象类和方法)
- * [接口创建](book/10-Interfaces.md#接口创建)
- * [抽象类和接口](book/10-Interfaces.md#抽象类和接口)
- * [完全解耦](book/10-Interfaces.md#完全解耦)
- * [多接口结合](book/10-Interfaces.md#多接口结合)
- * [使用继承扩展接口](book/10-Interfaces.md#使用继承扩展接口)
- * [接口适配](book/10-Interfaces.md#接口适配)
- * [接口字段](book/10-Interfaces.md#接口字段)
- * [接口嵌套](book/10-Interfaces.md#接口嵌套)
- * [接口和工厂方法模式](book/10-Interfaces.md#接口和工厂方法模式)
- * [本章小结](book/10-Interfaces.md#本章小结)
-* [第十一章 内部类](book/11-Inner-Classes.md)
- * [创建内部类](book/11-Inner-Classes.md#创建内部类)
- * [链接外部类](book/11-Inner-Classes.md#链接外部类)
- * [内部类this和new的使用](book/11-Inner-Classes.md#内部类this和new的使用)
- * [内部类向上转型](book/11-Inner-Classes.md#内部类向上转型)
- * [内部类方法和作用域](book/11-Inner-Classes.md#内部类方法和作用域)
- * [匿名内部类](book/11-Inner-Classes.md#匿名内部类)
- * [嵌套类](book/11-Inner-Classes.md#嵌套类)
- * [内部类应用场景](book/11-Inner-Classes.md#内部类应用场景)
- * [继承内部类](book/11-Inner-Classes.md#继承内部类)
- * [重写内部类](book/11-Inner-Classes.md#重写内部类)
- * [内部类局部变量](book/11-Inner-Classes.md#内部类局部变量)
- * [内部类标识符](book/11-Inner-Classes.md#内部类标识符)
- * [本章小结](book/11-Inner-Classes.md#本章小结)
-* [第十二章 集合](book/12-Collections.md)
- * [泛型和类型安全的集合](book/12-Collections.md#泛型和类型安全的集合)
- * [基本概念](book/12-Collections.md#基本概念)
- * [添加元素组](book/12-Collections.md#添加元素组)
- * [集合的打印](book/12-Collections.md#集合的打印)
- * [列表List](book/12-Collections.md#列表List)
- * [迭代器Iterators](book/12-Collections.md#迭代器Iterators)
- * [链表LinkedList](book/12-Collections.md#链表LinkedList)
- * [堆栈Stack](book/12-Collections.md#堆栈Stack)
- * [集合Set](book/12-Collections.md#集合Set)
- * [映射Map](book/12-Collections.md#映射Map)
- * [队列Queue](book/12-Collections.md#队列Queue)
- * [集合与迭代器](book/12-Collections.md#集合与迭代器)
- * [for-in和迭代器](book/12-Collections.md#for-in和迭代器)
- * [本章小结](book/12-Collections.md#本章小结)
-* [第十三章 函数式编程](book/13-Functional-Programming.md)
- * [旧vs新](book/13-Functional-Programming.md#旧vs新)
- * [Lambda表达式](book/13-Functional-Programming.md#Lambda表达式)
- * [方法引用](book/13-Functional-Programming.md#方法引用)
- * [函数式接口](book/13-Functional-Programming.md#函数式接口)
- * [高阶函数](book/13-Functional-Programming.md#高阶函数)
- * [闭包](book/13-Functional-Programming.md#闭包)
- * [函数组合](book/13-Functional-Programming.md#函数组合)
- * [Currying和Partial-Evaluation](book/13-Functional-Programming.md#Currying和Partial-Evaluation)
- * [纯函数式编程](book/13-Functional-Programming.md#纯函数式编程)
- * [本章小结](book/13-Functional-Programming.md#本章小结)
-* [第十四章 流式编程](book/14-Streams.md)
- * [流支持](book/14-Streams.md#流支持)
- * [流创建](book/14-Streams.md#流创建)
- * [中级流操作](book/14-Streams.md#中级流操作)
- * [Optional类](book/14-Streams.md#Optional类)
- * [终端操作](book/14-Streams.md#终端操作)
- * [本章小结](book/14-Streams.md#本章小结)
-* [第十五章 异常](book/15-Exceptions.md)
- * [异常概念](book/15-Exceptions.md#异常概念)
- * [基本异常](book/15-Exceptions.md#基本异常)
- * [异常捕获](book/15-Exceptions.md#异常捕获)
- * [自定义异常](book/15-Exceptions.md#自定义异常)
- * [异常规范](book/15-Exceptions.md#异常规范)
- * [任意异常捕获](book/15-Exceptions.md#任意异常捕获)
- * [Java标准异常](book/15-Exceptions.md#Java标准异常)
- * [finally关键字](book/15-Exceptions.md#finally关键字)
- * [异常限制](book/15-Exceptions.md#异常限制)
- * [异常构造](book/15-Exceptions.md#异常构造)
- * [Try-With-Resources用法](book/15-Exceptions.md#Try-With-Resources用法)
- * [异常匹配](book/15-Exceptions.md#异常匹配)
- * [异常准则](book/15-Exceptions.md#异常准则)
- * [异常指南](book/15-Exceptions.md#异常指南)
- * [本章小结](book/15-Exceptions.md#本章小结)
-* [第十六章 代码校验](book/16-Validating-Your-Code.md)
- * [测试](book/16-Validating-Your-Code.md#测试)
- * [前提条件](book/16-Validating-Your-Code.md#前提条件)
- * [测试驱动开发](book/16-Validating-Your-Code.md#测试驱动开发)
- * [日志](book/16-Validating-Your-Code.md#日志)
- * [调试](book/16-Validating-Your-Code.md#调试)
- * [基准测试](book/16-Validating-Your-Code.md#基准测试)
- * [分析和优化](book/16-Validating-Your-Code.md#分析和优化)
- * [风格检测](book/16-Validating-Your-Code.md#风格检测)
- * [静态错误分析](book/16-Validating-Your-Code.md#静态错误分析)
- * [代码重审](book/16-Validating-Your-Code.md#代码重审)
- * [结对编程](book/16-Validating-Your-Code.md#结对编程)
- * [重构](book/16-Validating-Your-Code.md#重构)
- * [持续集成](book/16-Validating-Your-Code.md#持续集成)
- * [本章小结](book/16-Validating-Your-Code.md#本章小结)
-* [第十七章 文件](book/17-Files.md)
- * [文件和目录路径](book/17-Files.md#文件和目录路径)
- * [目录](book/17-Files.md#目录)
- * [文件系统](book/17-Files.md#文件系统)
- * [路径监听](book/17-Files.md#路径监听)
- * [文件查找](book/17-Files.md#文件查找)
- * [文件读写](book/17-Files.md#文件读写)
- * [本章小结](book/17-Files.md#本章小结)
-* [第十八章 字符串](book/18-Strings.md)
- * [字符串的不可变](book/18-Strings.md#字符串的不可变)
- * [重载和StringBuilder](book/18-Strings.md#重载和StringBuilder)
- * [意外递归](book/18-Strings.md#意外递归)
- * [字符串操作](book/18-Strings.md#字符串操作)
- * [格式化输出](book/18-Strings.md#格式化输出)
- * [常规表达式](book/18-Strings.md#常规表达式)
- * [扫描输入](book/18-Strings.md#扫描输入)
- * [StringTokenizer类](book/18-Strings.md#StringTokenizer类)
- * [本章小结](book/18-Strings.md#本章小结)
-* [第十九章 类型信息](book/19-Type-Information.md)
- * [运行时类型信息](book/19-Type-Information.md#运行时类型信息)
- * [类的对象](book/19-Type-Information.md#类的对象)
- * [类型转换检测](book/19-Type-Information.md#类型转换检测)
- * [注册工厂](book/19-Type-Information.md#注册工厂)
- * [类的等价比较](book/19-Type-Information.md#类的等价比较)
- * [反射运行时类信息](book/19-Type-Information.md#反射运行时类信息)
- * [动态代理](book/19-Type-Information.md#动态代理)
- * [Optional类](book/19-Type-Information.md#Optional类)
- * [接口和类型](book/19-Type-Information.md#接口和类型)
- * [本章小结](book/19-Type-Information.md#本章小结)
-* [第二十章 泛型](book/20-Generics.md)
- * [简单泛型](book/20-Generics.md#简单泛型)
- * [泛型接口](book/20-Generics.md#泛型接口)
- * [泛型方法](book/20-Generics.md#泛型方法)
- * [复杂模型构建](book/20-Generics.md#复杂模型构建)
- * [泛型擦除](book/20-Generics.md#泛型擦除)
- * [补偿擦除](book/20-Generics.md#补偿擦除)
- * [边界](book/20-Generics.md#边界)
- * [通配符](book/20-Generics.md#通配符)
- * [问题](book/20-Generics.md#问题)
- * [自我约束类型](book/20-Generics.md#自我约束类型)
- * [动态类型安全](book/20-Generics.md#动态类型安全)
- * [泛型异常](book/20-Generics.md#泛型异常)
- * [混入](book/20-Generics.md#混入)
- * [潜在类型](book/20-Generics.md#潜在类型)
- * [补偿不足](book/20-Generics.md#补偿不足)
- * [辅助潜在类型](book/20-Generics.md#辅助潜在类型)
- * [泛型的优劣](book/20-Generics.md#泛型的优劣)
-* [第二十一章 数组](book/21-Arrays.md)
- * [数组特性](book/21-Arrays.md#数组特性)
- * [一等对象](book/21-Arrays.md#一等对象)
- * [返回数组](book/21-Arrays.md#返回数组)
- * [多维数组](book/21-Arrays.md#多维数组)
- * [泛型数组](book/21-Arrays.md#泛型数组)
- * [Arrays的fill方法](book/21-Arrays.md#Arrays的fill方法)
- * [Arrays的setAll方法](book/21-Arrays.md#Arrays的setAll方法)
- * [增量生成](book/21-Arrays.md#增量生成)
- * [随机生成](book/21-Arrays.md#随机生成)
- * [泛型和基本数组](book/21-Arrays.md#泛型和基本数组)
- * [数组元素修改](book/21-Arrays.md#数组元素修改)
- * [数组并行](book/21-Arrays.md#数组并行)
- * [Arrays工具类](book/21-Arrays.md#Arrays工具类)
- * [数组拷贝](book/21-Arrays.md#数组拷贝)
- * [数组比较](book/21-Arrays.md#数组比较)
- * [流和数组](book/21-Arrays.md#流和数组)
- * [数组排序](book/21-Arrays.md#数组排序)
- * [binarySearch二分查找](book/21-Arrays.md#binarySearch二分查找)
- * [parallelPrefix并行前缀](book/21-Arrays.md#parallelPrefix并行前缀)
- * [本章小结](book/21-Arrays.md#本章小结)
-* [第二十二章 枚举](book/22-Enumerations.md)
- * [基本功能](book/22-Enumerations.md#基本功能)
- * [方法添加](book/22-Enumerations.md#方法添加)
- * [switch语句](book/22-Enumerations.md#switch语句)
- * [values方法](book/22-Enumerations.md#values方法)
- * [实现而非继承](book/22-Enumerations.md#实现而非继承)
- * [随机选择](book/22-Enumerations.md#随机选择)
- * [使用接口组织](book/22-Enumerations.md#使用接口组织)
- * [使用EnumSet替代Flags](book/22-Enumerations.md#使用EnumSet替代Flags)
- * [使用EnumMap](book/22-Enumerations.md#使用EnumMap)
- * [常量特定方法](book/22-Enumerations.md#常量特定方法)
- * [多次调度](book/22-Enumerations.md#多次调度)
- * [本章小结](book/22-Enumerations.md#本章小结)
-* [第二十三章 注解](book/23-Annotations.md)
- * [基本语法](book/23-Annotations.md#基本语法)
- * [编写注解处理器](book/23-Annotations.md#编写注解处理器)
- * [使用javac处理注解](book/23-Annotations.md#使用javac处理注解)
- * [基于注解的单元测试](book/23-Annotations.md#基于注解的单元测试)
- * [本章小结](book/23-Annotations.md#本章小结)
-* [第二十四章 并发编程](book/24-Concurrent-Programming.md)
- * [术语问题](book/24-Concurrent-Programming.md#术语问题)
- * [并发的超能力](book/24-Concurrent-Programming.md#并发的超能力)
- * [针对速度](book/24-Concurrent-Programming.md#针对速度)
- * [四句格言](book/24-Concurrent-Programming.md#四句格言)
- * [残酷的真相](book/24-Concurrent-Programming.md#残酷的真相)
- * [本章其余部分](book/24-Concurrent-Programming.md#本章其余部分)
- * [并行流](book/24-Concurrent-Programming.md#并行流)
- * [创建和运行任务](book/24-Concurrent-Programming.md#创建和运行任务)
- * [终止耗时任务](book/24-Concurrent-Programming.md#终止耗时任务)
- * [CompletableFuture类](book/24-Concurrent-Programming.md#CompletableFuture类)
- * [死锁](book/24-Concurrent-Programming.md#死锁)
- * [构造函数非线程安全](book/24-Concurrent-Programming.md#构造函数非线程安全)
- * [复杂性和代价](book/24-Concurrent-Programming.md#复杂性和代价)
- * [本章小结](book/24-Concurrent-Programming.md#本章小结)
-* [第二十五章 设计模式](book/25-Patterns.md)
- * [概念](book/25-Patterns.md#概念)
- * [构建型](book/25-Patterns.md#构建型)
- * [面向实施](book/25-Patterns.md#面向实施)
- * [工厂模式](book/25-Patterns.md#工厂模式)
- * [函数对象](book/25-Patterns.md#函数对象)
- * [接口改变](book/25-Patterns.md#接口改变)
- * [解释器](book/25-Patterns.md#解释器)
- * [回调](book/25-Patterns.md#回调)
- * [多次调度](book/25-Patterns.md#多次调度)
- * [模式重构](book/25-Patterns.md#模式重构)
- * [抽象用法](book/25-Patterns.md#抽象用法)
- * [多次派遣](book/25-Patterns.md#多次派遣)
- * [访问者模式](book/25-Patterns.md#访问者模式)
- * [RTTI的优劣](book/25-Patterns.md#RTTI的优劣)
- * [本章小结](book/25-Patterns.md#本章小结)
-
-### 附录
-
-* [附录:补充](book/Appendix-Supplements.md)
- * [可下载的补充](book/Appendix-Supplements.md#可下载的补充)
- * [通过Thinking-in-C来巩固Java基础](book/Appendix-Supplements.md#通过Thinking-in-C来巩固Java基础)
- * [动手实践](book/Appendix-Supplements.md#动手实践)
-* [附录:编程指南](book/Appendix-Programming-Guidelines.md)
- * [设计](book/Appendix-Programming-Guidelines.md#设计)
- * [实现](book/Appendix-Programming-Guidelines.md#实现)
-* [附录:文档注释](book/Appendix-Javadoc.md)
-* [附录:对象传递和返回](book/Appendix-Passing-and-Returning-Objects.md)
- * [传递引用](book/Appendix-Passing-and-Returning-Objects.md#传递引用)
- * [本地拷贝](book/Appendix-Passing-and-Returning-Objects.md#本地拷贝)
- * [控制克隆](book/Appendix-Passing-and-Returning-Objects.md#控制克隆)
- * [不可变类](book/Appendix-Passing-and-Returning-Objects.md#不可变类)
- * [本章小结](book/Appendix-Passing-and-Returning-Objects.md#本章小结)
-* [附录:流式IO](book/Appendix-IO-Streams.md)
- * [输入流类型](book/Appendix-IO-Streams.md#输入流类型)
- * [输出流类型](book/Appendix-IO-Streams.md#输出流类型)
- * [添加属性和有用的接口](book/Appendix-IO-Streams.md#添加属性和有用的接口)
- * [Reader和Writer](book/Appendix-IO-Streams.md#Reader和Writer)
- * [RandomAccessFile类](book/Appendix-IO-Streams.md#RandomAccessFile类)
- * [IO流典型用途](book/Appendix-IO-Streams.md#IO流典型用途)
- * [本章小结](book/Appendix-IO-Streams.md#本章小结)
-* [附录:标准IO](book/Appendix-Standard-IO.md)
- * [执行控制](book/Appendix-Standard-IO.md#执行控制)
-* [附录:新IO](book/Appendix-New-IO.md)
- * [ByteBuffer](book/Appendix-New-IO.md#ByteBuffer)
- * [转换数据](book/Appendix-New-IO.md#转换数据)
- * [获取原始类型](book/Appendix-New-IO.md#获取原始类型)
- * [视图缓冲区](book/Appendix-New-IO.md#视图缓冲区)
- * [使用缓冲区进行数据操作](book/Appendix-New-IO.md#使用缓冲区进行数据操作)
- * [内存映射文件](book/Appendix-New-IO.md#内存映射文件)
- * [文件锁定](book/Appendix-New-IO.md#文件锁定)
-* [附录:理解equals和hashCode方法](book/Appendix-Understanding-equals-and-hashCode.md)
- * [equals典范](book/Appendix-Understanding-equals-and-hashCode.md#equals典范)
- * [哈希和哈希码](book/Appendix-Understanding-equals-and-hashCode.md#哈希和哈希码)
- * [调整HashMap](book/Appendix-Understanding-equals-and-hashCode.md#调整HashMap)
-* [附录:集合主题](book/Appendix-Collection-Topics.md)
- * [示例数据](book/Appendix-Collection-Topics.md#示例数据)
- * [List表现](book/Appendix-Collection-Topics.md#List表现)
- * [Set表现](book/Appendix-Collection-Topics.md#Set表现)
- * [在Map中使用函数式操作](book/Appendix-Collection-Topics.md#在Map中使用函数式操作)
- * [选择Map的部分](book/Appendix-Collection-Topics.md#选择Map的部分)
- * [集合的fill方法](book/Appendix-Collection-Topics.md#集合的fill方法)
- * [使用Flyweight自定义集合和Map](book/Appendix-Collection-Topics.md#使用Flyweight自定义集合和Map)
- * [集合功能](book/Appendix-Collection-Topics.md#集合功能)
- * [可选操作](book/Appendix-Collection-Topics.md#可选操作)
- * [Set和存储顺序](book/Appendix-Collection-Topics.md#Set和存储顺序)
- * [队列](book/Appendix-Collection-Topics.md#队列)
- * [理解Map](book/Appendix-Collection-Topics.md#理解Map)
- * [集合工具类](book/Appendix-Collection-Topics.md#集合工具类)
- * [持有引用](book/Appendix-Collection-Topics.md#持有引用)
- * [避免旧式类库](book/Appendix-Collection-Topics.md#避免旧式类库)
- * [本章小结](book/Appendix-Collection-Topics.md#本章小结)
-* [附录:并发底层原理](book/Appendix-Low-Level-Concurrency.md)
- * [线程](book/Appendix-Low-Level-Concurrency.md#线程)
- * [异常捕获](book/Appendix-Low-Level-Concurrency.md#异常捕获)
- * [资源共享](book/Appendix-Low-Level-Concurrency.md#资源共享)
- * [volatile关键字](book/Appendix-Low-Level-Concurrency.md#volatile关键字)
- * [原子性](book/Appendix-Low-Level-Concurrency.md#原子性)
- * [关键部分](book/Appendix-Low-Level-Concurrency.md#关键部分)
- * [库组件](book/Appendix-Low-Level-Concurrency.md#库组件)
- * [本章小结](book/Appendix-Low-Level-Concurrency.md#本章小结)
-* [附录:数据压缩](book/Appendix-Data-Compression.md)
- * [使用Gzip简单压缩](book/Appendix-Data-Compression.md#使用Gzip简单压缩)
- * [使用zip多文件存储](book/Appendix-Data-Compression.md#使用zip多文件存储)
- * [Java的jar](book/Appendix-Data-Compression.md#Java的jar)
-* [附录:对象序列化](book/Appendix-Object-Serialization.md)
- * [查找类](book/Appendix-Object-Serialization.md#查找类)
- * [控制序列化](book/Appendix-Object-Serialization.md#控制序列化)
- * [使用持久化](book/Appendix-Object-Serialization.md#使用持久化)
-* [附录:静态语言类型检查](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md)
- * [前言](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#前言)
- * [静态类型检查和测试](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#静态类型检查和测试)
- * [如何提升打字](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#如何提升打字)
- * [生产力的成本](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#生产力的成本)
- * [静态和动态](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#静态和动态)
-* [附录:C++和Java的优良传统](book/Appendix-The-Positive-Legacy-of-C-plus-plus-and-Java.md)
-* [附录:成为一名程序员](book/Appendix-Becoming-a-Programmer.md)
- * [如何开始](book/Appendix-Becoming-a-Programmer.md#如何开始)
- * [码农生涯](book/Appendix-Becoming-a-Programmer.md#码农生涯)
- * [百分之五的神话](book/Appendix-Becoming-a-Programmer.md#百分之五的神话)
- * [重在动手](book/Appendix-Becoming-a-Programmer.md#重在动手)
- * [像打字般编程](book/Appendix-Becoming-a-Programmer.md#像打字般编程)
- * [做你喜欢的事](book/Appendix-Becoming-a-Programmer.md#做你喜欢的事)
-* [词汇表](GLOSSARY.md)
+* [附录:补充](docs/book/Appendix-Supplements.md)
+ * [可下载的补充](docs/book/Appendix-Supplements.md#可下载的补充)
+ * [通过Thinking-in-C来巩固Java基础](docs/book/Appendix-Supplements.md#通过Thinking-in-C来巩固Java基础)
+ * [动手实践](docs/book/Appendix-Supplements.md#动手实践)
+* [附录:编程指南](docs/book/Appendix-Programming-Guidelines.md)
+ * [设计](docs/book/Appendix-Programming-Guidelines.md#设计)
+ * [实现](docs/book/Appendix-Programming-Guidelines.md#实现)
+* [附录:文档注释](docs/book/Appendix-Javadoc.md)
+* [附录:对象传递和返回](docs/book/Appendix-Passing-and-Returning-Objects.md)
+ * [传递引用](docs/book/Appendix-Passing-and-Returning-Objects.md#传递引用)
+ * [本地拷贝](docs/book/Appendix-Passing-and-Returning-Objects.md#本地拷贝)
+ * [控制克隆](docs/book/Appendix-Passing-and-Returning-Objects.md#控制克隆)
+ * [不可变类](docs/book/Appendix-Passing-and-Returning-Objects.md#不可变类)
+ * [本章小结](docs/book/Appendix-Passing-and-Returning-Objects.md#本章小结)
+* [附录:流式IO](docs/book/Appendix-IO-Streams.md)
+ * [输入流类型](docs/book/Appendix-IO-Streams.md#输入流类型)
+ * [输出流类型](docs/book/Appendix-IO-Streams.md#输出流类型)
+ * [添加属性和有用的接口](docs/book/Appendix-IO-Streams.md#添加属性和有用的接口)
+ * [Reader和Writer](docs/book/Appendix-IO-Streams.md#Reader和Writer)
+ * [RandomAccessFile类](docs/book/Appendix-IO-Streams.md#RandomAccessFile类)
+ * [IO流典型用途](docs/book/Appendix-IO-Streams.md#IO流典型用途)
+ * [本章小结](docs/book/Appendix-IO-Streams.md#本章小结)
+* [附录:标准IO](docs/book/Appendix-Standard-IO.md)
+ * [执行控制](docs/book/Appendix-Standard-IO.md#执行控制)
+* [附录:新IO](docs/book/Appendix-New-IO.md)
+ * [ByteBuffer](docs/book/Appendix-New-IO.md#ByteBuffer)
+ * [转换数据](docs/book/Appendix-New-IO.md#数据转换)
+ * [获取原始类型](docs/book/Appendix-New-IO.md#基本类型获取)
+ * [视图缓冲区](docs/book/Appendix-New-IO.md#视图缓冲区)
+ * [使用缓冲区进行数据操作](docs/book/Appendix-New-IO.md#缓冲区数据操作)
+ * [内存映射文件](docs/book/Appendix-New-IO.md#内存映射文件)
+ * [文件锁定](docs/book/Appendix-New-IO.md#文件锁定)
+* [附录:理解equals和hashCode方法](docs/book/Appendix-Understanding-equals-and-hashCode.md)
+ * [equals典范](docs/book/Appendix-Understanding-equals-and-hashCode.md#equals典范)
+ * [哈希和哈希码](docs/book/Appendix-Understanding-equals-and-hashCode.md#哈希和哈希码)
+ * [调整HashMap](docs/book/Appendix-Understanding-equals-and-hashCode.md#调整HashMap)
+* [附录:集合主题](docs/book/Appendix-Collection-Topics.md)
+ * [示例数据](docs/book/Appendix-Collection-Topics.md#示例数据)
+ * [List表现](docs/book/Appendix-Collection-Topics.md#List表现)
+ * [Set表现](docs/book/Appendix-Collection-Topics.md#Set表现)
+ * [在Map中使用函数式操作](docs/book/Appendix-Collection-Topics.md#在Map中使用函数式操作)
+ * [选择Map的部分](docs/book/Appendix-Collection-Topics.md#选择Map的部分)
+ * [集合的fill方法](docs/book/Appendix-Collection-Topics.md#集合的fill方法)
+ * [使用Flyweight自定义集合和Map](docs/book/Appendix-Collection-Topics.md#使用Flyweight自定义集合和Map)
+ * [集合功能](docs/book/Appendix-Collection-Topics.md#集合功能)
+ * [可选操作](docs/book/Appendix-Collection-Topics.md#可选操作)
+ * [Set和存储顺序](docs/book/Appendix-Collection-Topics.md#Set和存储顺序)
+ * [队列](docs/book/Appendix-Collection-Topics.md#队列)
+ * [理解Map](docs/book/Appendix-Collection-Topics.md#理解Map)
+ * [集合工具类](docs/book/Appendix-Collection-Topics.md#集合工具类)
+ * [持有引用](docs/book/Appendix-Collection-Topics.md#持有引用)
+ * [避免旧式类库](docs/book/Appendix-Collection-Topics.md#避免旧式类库)
+ * [本章小结](docs/book/Appendix-Collection-Topics.md#本章小结)
+* [附录:并发底层原理](docs/book/Appendix-Low-Level-Concurrency.md)
+ * [线程](docs/book/Appendix-Low-Level-Concurrency.md#线程)
+ * [异常捕获](docs/book/Appendix-Low-Level-Concurrency.md#异常捕获)
+ * [资源共享](docs/book/Appendix-Low-Level-Concurrency.md#资源共享)
+ * [volatile关键字](docs/book/Appendix-Low-Level-Concurrency.md#volatile关键字)
+ * [原子性](docs/book/Appendix-Low-Level-Concurrency.md#原子性)
+ * [关键部分](docs/book/Appendix-Low-Level-Concurrency.md#关键部分)
+ * [库组件](docs/book/Appendix-Low-Level-Concurrency.md#库组件)
+ * [本章小结](docs/book/Appendix-Low-Level-Concurrency.md#本章小结)
+* [附录:数据压缩](docs/book/Appendix-Data-Compression.md)
+ * [使用Gzip简单压缩](docs/book/Appendix-Data-Compression.md#使用Gzip简单压缩)
+ * [使用zip多文件存储](docs/book/Appendix-Data-Compression.md#使用zip多文件存储)
+ * [Java的jar](docs/book/Appendix-Data-Compression.md#Java的jar)
+* [附录:对象序列化](docs/book/Appendix-Object-Serialization.md)
+ * [查找类](docs/book/Appendix-Object-Serialization.md#查找类)
+ * [控制序列化](docs/book/Appendix-Object-Serialization.md#控制序列化)
+ * [使用持久化](docs/book/Appendix-Object-Serialization.md#使用持久化)
+* [附录:静态语言类型检查](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md)
+ * [前言](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#前言)
+ * [静态类型检查和测试](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#静态类型检查和测试)
+ * [如何提升打字](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#如何提升打字)
+ * [生产力的成本](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#生产力的成本)
+ * [静态和动态](docs/book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#静态和动态)
+* [附录:C++和Java的优良传统](docs/book/Appendix-The-Positive-Legacy-of-C-plus-plus-and-Java.md)
+* [附录:成为一名程序员](docs/book/Appendix-Becoming-a-Programmer.md)
+ * [如何开始](docs/book/Appendix-Becoming-a-Programmer.md#如何开始)
+ * [码农生涯](docs/book/Appendix-Becoming-a-Programmer.md#码农生涯)
+ * [百分之五的神话](docs/book/Appendix-Becoming-a-Programmer.md#百分之五的神话)
+ * [重在动手](docs/book/Appendix-Becoming-a-Programmer.md#重在动手)
+ * [像打字般编程](docs/book/Appendix-Becoming-a-Programmer.md#像打字般编程)
+ * [做你喜欢的事](docs/book/Appendix-Becoming-a-Programmer.md#做你喜欢的事)
+* [词汇表](docs/book/GLOSSARY.md)
diff --git a/assets/LogoMark.png b/assets/LogoMark.png
new file mode 100644
index 0000000..8fdee22
Binary files /dev/null and b/assets/LogoMark.png differ
diff --git a/images/QQGroupQRCode.png b/assets/QQGroupQRCode.png
similarity index 100%
rename from images/QQGroupQRCode.png
rename to assets/QQGroupQRCode.png
diff --git a/book.json b/book.json
index f99031f..dd18be4 100644
--- a/book.json
+++ b/book.json
@@ -1,7 +1,7 @@
{
"title": "《On Java 8》中文版",
"author": "LingCoder",
- "description": "根据Bruce Eckel大神的新书On Java 8翻译,可以说是事实上的Thinking in Java 5th",
+ "description": "根据 Bruce Eckel 大神的新书 On Java 8 翻译,可以说是事实上的 Thinking in Java 5th",
"language": "zh-hans",
"gitbook": "3.2.3",
"styles": {
@@ -11,9 +11,6 @@
"mobi": "styles/mobi.css",
"epub": "styles/epub.css"
},
- "structure": {
- "readme": "Introduction.md"
- },
"plugins": [
"splitter",
"edit-link",
diff --git a/book/04-Operators.md b/book/04-Operators.md
deleted file mode 100644
index 8247c50..0000000
--- a/book/04-Operators.md
+++ /dev/null
@@ -1,681 +0,0 @@
-[TOC]
-
-
-# 第四章 运算符
-
-
->运算符操纵数据。
-
-Java 是从 C++ 的基础上做了一些改进和简化发展而成的。对于 C/C++ 程序员来说,Java 的运算符并不陌生。如果你已了解 C 或 C++,大可以跳过本章和下一章,直接阅读 Java 与 C/C++ 不同的地方。
-
-如果理解这两章的内容对你来说还有点困难,那么我推荐你先了解下 *Thinking in C* 再继续后面的学习。 这本书现在可以在 [www.OnJava8.com](http://www.OnJava8.com]) 上免费下载。它的内容包含音频讲座、幻灯片、练习和解决方案,专门用于帮助你快速掌握学习 Java 所需的基础知识。
-
-
-
-## 使用说明
-
-
-运算符接受一个或多个参数并生成新值。这个参数与普通方法调用的形式是不同的,但效果是相同的。加法 `+`,减法 `-`,乘法 `*`,除法 `/` 以及赋值 `=` 在任何编程语言中的工作方式都是类似的。所有运算符都能根据自己的运算对象生成一个值。除此以外,一个运算符可改变运算对象的值,这叫作“副作用”(**Side Effect**)。运算符最常见的用途就是修改自己的运算对象,从而产生副作用。但要注意生成的值亦可由没有副作用的运算符生成。
-
-几乎所有运算符都只能操作基本类型(*Primitives*)。唯一的例外是 `=`、`==` 和 `!=`,它们能操作所有对象(这也是令人混淆的一个地方)。除此以外,**String** 类支持 `+` 和 `+=`。
-
-
-
-## 优先级
-
-
-运算符的优先级决定了存在多个运算符时一个表达式各部分的计算顺序。Java 对计算顺序作出了特别的规定。其中,最简单的规则就是乘法和除法在加法和减法之前完成。程序员经常都会忘记其他优先级规则,所以应该用括号明确规定计算顺序。代码示例:
-
-```JAVA
-// operators/Precedence.java
-public class Precedence {
-
- public static void main(String[] args) {
- int x = 1, y = 2, z = 3;
- int a = x + y - 2/2 + z; // [1]
- int b = x + (y - 2)/(2 + z); // [2]
- System.out.println("a = " + a);
- System.out.println("b = " + b);
- }
-}
-```
-
- 输出结果:
-
-```
- a = 5
- b = 1
-```
-
-这些语句看起来大致相同,但从输出中我们可以看出它们具有非常不同的含义,具体取决于括号的使用。
-
-我们注意到,在 `System.out.println()` 语句中使用了 `+` 运算符。 但是在这里 `+` 代表的意思是字符串连接符。编译器会将 `+` 连接的非字符串尝试转换为字符串。上例中的输出结果说明了 a 和 b 都已经被转化成了字符串。
-
-
-
-## 赋值
-
-
-运算符的赋值是由符号 `=` 完成的。它代表着获取 `=` 右边的值并赋给左边的变量。右边可以是任何常量、变量或者是可产生一个返回值的表达式。但左边必须是一个明确的、已命名的变量。也就是说,必须要有一个物理的空间来存放右边的值。举个例子来说,可将一个常数赋给一个变量( A = 4 ),但不可将任何东西赋给一个常数(比如不能 4 = A)。
-
-基本类型的赋值都是直接的,而不像对象,赋予的只是其内存的引用。举个例子,a = b ,如果 b 是基本类型,那么 赋值操作会将 b 的值复制一根给变量 a, 此后若 a 的值发生改变是不会影响到 b 的。作为一名程序员,着应该成为我们的常识。
-
-如果是为对象赋值,那么结果就不一样了。对一个对象进行操作时,我们实际上操作的是它的引用。所以我们将右边的对象赋予给左边时,赋予的只是该对象的引用。此时,两者指向的堆中的对象还是同一个。代码示例:
-
-```JAVA
-// operators/Assignment.java
-// Assignment with objects is a bit tricky
-class Tank {
- int level;
-}
-
-public class Assignment {
-
- public static void main(String[] args) {
- Tank t1 = new Tank();
- Tank t2 = new Tank();
- t1.level = 9;
- t2.level = 47;
- System.out.println("1: t1.level: " + t1.level +
- ", t2.level: " + t2.level);
- t1 = t2;
- System.out.println("2: t1.level: " + t1.level +
- ", t2.level: " + t2.level);
- t1.level = 27;
- System.out.println("3: t1.level: " + t1.level +
- ", t2.level: " + t2.level);
- }
-}
-```
-
-输出结果:
-
-```
-1: t1.level: 9, t2.level: 47
-2: t1.level: 47, t2.level: 47
-3: t1.level: 27, t2.level: 27
-```
-
-这是个简单的 `Tank` 类,通过 main 方法 `new` 出了 2 个实例对象。 两个对象的 `level` 属性分别被赋予了不同的值。 然后,t2 的值被赋予给 t1。在许多编程语言里,预期的结果是 t1 和 t2 的值会一直相对独立。但是,在 Java 中,由于赋予的只是对象的引用,改变 t1 也就改变了 t2。 这是因为 t1 和 t2 此时指向的是堆中同一个对象。(t1 原始对象的引用在 t2 赋值给其时被丢失,它就将会在垃圾回收时被清理)。
-
-这种现象通常称为别名(*aliasing*),这是 Java 处理对象的一种基本方式。但是假若你不想这里出现这样的混淆的话,你可以这么做。代码示例:
-
-```JAVA
-t1.level = t2.level;
-```
-
-较之前的做法,这样做保留了两个单独的对象,而不是丢弃一个并将 t1 和 t2 绑定到同一个对象。但是这样的操作有点违背 JAVA 的设计原则。对象的赋值是个需要重视的环节,否则你可能收获意外的“惊喜”。
-
-
-### 方法调用中的别名现象
-
-当我们把对象传递给方法时,会发生别名现象。
-
-```JAVA
-// operators/PassObject.java
-// 正在传递的对象可能不是你之前使用的
-class Letter {
- char c;
- }
-
-public class PassObject {
- static void f(Letter y) {
- y.c = 'z';
- }
-
- public static void main(String[] args) {
- Letter x = new Letter();
- x.c = 'a';
- System.out.println("1: x.c: " + x.c);
- f(x);
- System.out.println("2: x.c: " + x.c);
- }
-}
-```
-
-输出结果:
-
-```
-1: x.c: a
-2: x.c: z
-```
-
-在许多编程语言中,方法 **f()** 似乎在内部复制其参数 **Letter y**。但是一旦传递了一个引用,那么实际上 `y.c ='z';` 是在方法 **f()** 之外改变对象。别名现象以及其解决方案是个复杂的问题,在附录中有包含:[对象传递和返回](./Appendix-Passing-and-Returning-Objects.md)。意识到这一点,我们可以警惕类似的陷阱。
-
-
-
-## 算术运算符
-
-Java 的基本算术运算符与其他大多编程语言是相同的。其中包括加号 `+`、减号 `-`、除号 `/`、乘号 `*` 以及模数`%`(从整数除法中获得余数)。整数除法会直接砍掉小数,而不是进位。
-
-Java 也用一种简写形式同时进行运算和赋值操作,由运算符后跟等号表示,并且与语言中的所有运算符一致(只要有意义)。为了将 4 的值赋予给变量 x 同时将结果赋予给 x , 可用 x += 4 来表示。下面带来代码更多代码示例:
-
-
-```JAVA
-// operators/MathOps.java
-// The mathematical operators
-import java.util.*;
-
-public class MathOps {
- public static void main(String[] args) {
- // Create a seeded random number generator:
- Random rand = new Random(47);
- int i, j, k;
- // Choose value from 1 to 100:
- j = rand.nextInt(100) + 1;
- System.out.println("j : " + j);
- k = rand.nextInt(100) + 1;
- System.out.println("k : " + k);
- i = j + k;
- System.out.println("j + k : " + i);
- i = j - k;
- System.out.println("j - k : " + i);
- i = k / j;
- System.out.println("k / j : " + i);
- i = k * j;
- System.out.println("k * j : " + i);
- i = k % j;
- System.out.println("k % j : " + i);
- j %= k;
- System.out.println("j %= k : " + j);
- // 浮点运算测试
- float u, v, w; // Applies to doubles, too
- v = rand.nextFloat();
- System.out.println("v : " + v);
- w = rand.nextFloat();
- System.out.println("w : " + w);
- u = v + w;
- System.out.println("v + w : " + u);
- u = v - w;
- System.out.println("v - w : " + u);
- u = v * w;
- System.out.println("v * w : " + u);
- u = v / w;
- System.out.println("v / w : " + u);
- // 下面的操作同样适用于 char,
- // byte, short, int, long, and double:
- u += v;
- System.out.println("u += v : " + u);
- u -= v;
- System.out.println("u -= v : " + u);
- u *= v;
- System.out.println("u *= v : " + u);
- u /= v;
- System.out.println("u /= v : " + u);
- }
-}
-
-```
-
-输出结果:
-
-```
-j : 59
-k : 56
-j + k : 115
-j - k : 3
-k / j : 0
-k * j : 3304
-k % j : 56
-j %= k : 3
-v : 0.5309454
-w : 0.0534122
-v + w : 0.5843576
-v - w : 0.47753322
-v * w : 0.028358962
-v / w : 9.940527
-u += v : 10.471473
-u -= v : 9.940527
-u *= v : 5.2778773
-u /= v : 9.940527
-```
-
-为了生成随机数字,程序首先创建一个 **Random** 对象。不带参数的 **Random** 对象会利用当前的时间用作随机数生成器的“种子”(*seed*),从而为程序的每次执行生成不同的输出。在本书的示例中,重要的是每个示例末尾的输出尽可能一致,以便可以使用外部工具进行验证。所以我们通过在创建 **Random** 对象时提供种子(随机数生成器的初始化值,其始终为特定种子值产生相同的序列),让程序每次执行都生成相同的随机数,如此以来输出结果就是可验证的 [^1]。 若需要生成随机值,可删除代码示例中的种子参数。该对象通过调用方法 **nextInt()** 和 **nextFloat()**(还可以调用 **nextLong()** 或 **nextDouble()**),使用 **Random** 对象生成许多不同类型的随机数。**nextInt()** 的参数设置生成的数字的上限,下限为零,为了避免零除的可能性,结果偏移1。
-
-
-
-### 一元加减运算符
-
-一元加 `+` 减 `-` 运算符的操作和二元是相同的。编译器可自动识别使用何种方式解析运算:
-
-```JAVA
-x = -a;
-```
-
-上例的代码表意清晰,编译器可正确识别。下面再看一个示例:
-
-```JAVA
-x = a * -b;
-```
-
-虽然编译器可以正确的识别,但是程序员可能会迷惑。为了避免混淆,推荐下面的写法:
-
-```JAVA
-x = a * (-b);
-```
-
-一元减号可以得到数据的负值。一元加号的作用相反,不过它唯一能影响的就是把较小的数值类型自动转换为了 **int** 类型。
-
-
-
-## 递增和递减
-
-
-和 C 语言类似,Java 提供了许多快捷运算方式。快捷运算可使代码可读性,可写性都更强。其中包括递增 `++` 和递减 `--`,意为“增加或减少一个单位”。举个例子来说,假设 a 是一个 **int** 类型的值,则表达式 `++a` 就等价于 `a = a + 1`。 递增和递减运算符不仅可以修改变量,还可以生成变量的值。
-
-每种类型的运算符,都有两个版本可供选用;通常将其称为“前缀版”和“后缀版”。“前递增”表示 `++` 运算符位于变量或表达式的前面;而“后递增”表示 `++` 运算符位于变量或表达式的后面。类似地,“前递减”意味着 `--` 运算符位于变量或表达式的前面;而“后递减”意味着 `--` 运算符位于变量或表达式的后面。对于前递增和前递减(如 `++a` 或 `--a`),会先执行递增/减运算,再返回值。而对于后递增和后递减(如 `a++` 或 `a--`),会先返回值,再执行递增/减运算。代码示例:
-
-```JAVA
-// operators/AutoInc.java
-// 演示 ++ 和 -- 运算符
-public class AutoInc {
- public static void main(String[] args) {
- int i = 1;
- System.out.println("i: " + i);
- System.out.println("++i: " + ++i); // 前递增
- System.out.println("i++: " + i++); // 后递增
- System.out.println("i: " + i);
- System.out.println("--i: " + --i); // 前递减
- System.out.println("i--: " + i--); // 后递减
- System.out.println("i: " + i);
- }
-}
-```
-
-输出结果:
-
-```
-i: 1
-++i: 2
-i++: 2
-i: 3
---i: 2
-i--: 2
-i: 1
-```
-
-对于前缀形式,我们将在执行递增/减操作后获取值;使用后缀形式,我们将在执行递增/减操作之前获取值。它们是唯一具有“副作用”的运算符(除那些涉及赋值的以外) —— 它们既改变操作数又改变值。
-
-C++ 名称来自于递增运算符,同时也代表着“比 C 更进一步”。在早期的 Java 演讲中,*Bill Joy*( Java 创建者之一)说“**Java = C ++ --**”(C++ 减减)。这意味着 Java 是在 C++ 的基础上减少了许多不必要的东西,因此语言更简单。随着进一步地学习,我们会发现 Java 的确有许多地方相对 C++ 来说更简便,但是在其他方面,难度并不会比 C++ 小多少。
-
-
-
-## 关系运算符
-
-
-关系运算符会通过产生一个布尔(**boolean**)结果来表示被操作的数值之间的关系。如果关系为真,则结果为 **true**,如果关系非真,则结果为 **false**。关系运算符包括小于 `<`,大于 `>`,小于或等于 `<=`,大于或等于 `>=`,等价 `==` 和不等价 `!=`。`==` 和 `!=` 可与所有基本类型搭配使用。但与其他类型的比较就不太适合了,因为布尔值只能表示 **true** 或 **false**,所以比较它们之间的“大于”或“小于”没有意义。
-
-
-### 测试对象等价
-
-关系运算符 `==` 和 `!=` 同样适用于所有对象之间的比较运算,但产生的结果却经常混淆 Java 的初学者。下面是代码示例:
-
-```JAVA
-// operators/Equivalence.java
-public class Equivalence {
- public static void main(String[] args) {
- Integer n1 = 47;
- Integer n2 = 47;
- System.out.println(n1 == n2);
- System.out.println(n1 != n2);
- }
-}
-```
-
-输出结果:
-
-```
-true
-false
-```
-
-上例的结果看起来是我们所期望的。但其实事情并非那么简单。下面我们来创建自己的类:
-
-```JAVA
-// operators/EqualsMethod2.java
-// 默认的 equals() 方法没有比较内容
-class Value {
-int i;
-}
-
-public class EqualsMethod2 {
- public static void main(String[] args) {
- Value v1 = new Value();
- Value v2 = new Value();
- v1.i = v2.i = 100;
- System.out.println(v1.equals(v2));
- }
-}
-```
-
-输出结果:
-
-```
-false
-```
-
-上例的结果再次令人困惑:结果是错误的。原因: **equals()** 的默认行为是比较对象的引用而非具体内容。因此,除非你在新类中重写 **equals()** 方法,否则我们将获取不到想要的结果。不幸的是,在学习 [复用](./08-Reuse.md)(**Reuse**) 章节后我们才能接触到“覆盖”(**override**),并且直到 [附录:集合主题](./Appendix-Collection-Topics.md),才能知道定义 **equals()** 方法的正确方式,但是现在明白 **equals()** 行为方式也可能为你节省一些时间。
-
-大多数 Java 库类通过覆写 **equals()** 方法比较对象的内容而不是其引用。
-
-
-## 逻辑运算符
-
-每个逻辑运算符 `&&` (**AND**)、`||`(**OR**)和 `!`(**非**)根据参数的逻辑关系生成布尔值 `true` 或 `false`。下面的代码示例使用了关系运算符和逻辑运算符:
-
-```JAVA
-// operators/Bool.java
-// 关系运算符和逻辑运算符
-import java.util.*;
-public class Bool {
- public static void main(String[] args) {
- Random rand = new Random(47);
- int i = rand.nextInt(100);
- int j = rand.nextInt(100);
- System.out.println("i = " + i);
- System.out.println("j = " + j);
- System.out.println("i > j is " + (i > j));
- System.out.println("i < j is " + (i < j));
- System.out.println("i >= j is " + (i >= j));
- System.out.println("i <= j is " + (i <= j));
- System.out.println("i == j is " + (i == j));
- System.out.println("i != j is " + (i != j));
- // 将 int 作为布尔处理不是合法的 Java 写法
- //- System.out.println("i && j is " + (i && j));
- //- System.out.println("i || j is " + (i || j));
- //- System.out.println("!i is " + !i);
- System.out.println("(i < 10) && (j < 10) is "
- + ((i < 10) && (j < 10)) );
- System.out.println("(i < 10) || (j < 10) is "
- + ((i < 10) || (j < 10)) );
- }
-}
-```
-
-输出结果:
-
-```
-i = 58
-j = 55
-i > j is true
-i < j is false
-i >= j is true
-i <= j is false
-i == j is false
-i != j is true
-(i < 10) && (j < 10) is false
-(i < 10) || (j < 10) is false
-```
-
-在 JAVA 逻辑运算中,我们不能像 C/C++ 那样使用非布尔值, 而仅能使用 **AND**、**OR**、**NOT**。
-下面是一次错误的尝试: ~~a || -~~。 但是,后续表达式使用关系比较生成布尔值,然后对结果使用逻辑运算结果。请注意,如果在预期为 **String** 类型的位置使用 **boolean**类型的值,则结果会自动转为适当的文本格式。
-
-我们可以将前一个程序中 **int** 的定义替换为除 **boolean** 之外的任何其他基本数据类型。
-但请注意,**float** 类型的数值比较非常严格。只要最小位部分的数字不同则两个数值之间的比较仍然是“非等”的;只要数字最小位是大于 0 的,那么它就不等于 0。
-
-
-
-### 短路
-
-逻辑运算符支持一种称为“短路”(*short-circuiting*)的现象。整个表达式会在运算到可以明确结果时就停止并返回结果,这意味着该逻辑表达式的后半部分不会被执行到。代码示例:
-
-```JAVA
-// operators / ShortCircuit.java
-// 逻辑运算符的短路行为
-public class ShortCircuit {
-
- static boolean test1(int val) {
- System.out.println("test1(" + val + ")");
- System.out.println("result: " + (val < 1));
- return val < 1;
- }
-
- static boolean test2(int val) {
- System.out.println("test2(" + val + ")");
- System.out.println("result: " + (val < 2));
- return val < 2;
- }
-
- static boolean test3(int val) {
- System.out.println("test3(" + val + ")");
- System.out.println("result: " + (val < 3));
- return val < 3;
- }
-
- public static void main(String[] args) {
- boolean b = test1(0) && test2(2) && test3(2);
- System.out.println("expression is " + b);
- }
-}
-```
-
-输出结果:
-
-```
-test1(0)
-result: true
-test2(2)
-result: false
-expression is false
-```
-
-每个测试都对参数执行比较并返回 `true` 或 `false`。同时控制台也会在方法执行时打印他们的执行状态。 下面的表达式:
-
-```JAVA
-test1(0)&& test2(2)&& test3(2)
-```
-
-可能你的预期是程序会执行 3 个 **test** 方法并返回。我们来分析一下:第一个方法的结果返回 `true`,因此表达式会继续走下去。紧接着,第二个方法的返回结果是 `false`。这就代表这整个表达式的结果肯定为 `false`,所以就没有必要再判断剩下的表达式部分了。
-
-所以,运用“短路”可以节省部分不必要的运算,从而提高程序潜在的性能。
-
-
-
-## 字面值常量
-
-
-通常,当我们向程序中插入一个字面值常量(**Literal**)时,编译器会确切地识别它的类型。当类型不明确时,必须辅以字面值常量关联来帮助编译器识别。代码示例:
-
-```JAVA
-// operators/Literals.java
-public class Literals {
- public static void main(String[] args) {
- int i1 = 0x2f; // 16进制 (小写)
- System.out.println(
- "i1: " + Integer.toBinaryString(i1));
- int i2 = 0X2F; // 16进制 (大写)
- System.out.println(
- "i2: " + Integer.toBinaryString(i2));
- int i3 = 0177; // 8进制 (前导0)
- System.out.println(
- "i3: " + Integer.toBinaryString(i3));
- char c = 0xffff; // 最大 char 型16进制值
- System.out.println(
- "c: " + Integer.toBinaryString(c));
- byte b = 0x7f; // 最大 byte 型16进制值 10101111;
- System.out.println(
- "b: " + Integer.toBinaryString(b));
- short s = 0x7fff; // 最大 short 型16进制值
- System.out.println(
- "s: " + Integer.toBinaryString(s));
- long n1 = 200L; // long 型后缀
- long n2 = 200l; // long 型后缀 (容易与数值1混淆)
- long n3 = 200;
-
- // Java 7 二进制字面值常量:
- byte blb = (byte)0b00110101;
- System.out.println(
- "blb: " + Integer.toBinaryString(blb));
- short bls = (short)0B0010111110101111;
- System.out.println(
- "bls: " + Integer.toBinaryString(bls));
- int bli = 0b00101111101011111010111110101111;
- System.out.println(
- "bli: " + Integer.toBinaryString(bli));
- long bll = 0b00101111101011111010111110101111;
- System.out.println(
- "bll: " + Long.toBinaryString(bll));
- float f1 = 1;
- float f2 = 1F; // float 型后缀
- float f3 = 1f; // float 型后缀
- double d1 = 1d; // double 型后缀
- double d2 = 1D; // double 型后缀
- // (long 型的字面值同样适用于十六进制和8进制 )
- }
-}
-```
-
-输出结果:
-
-```
-i1: 101111
-i2: 101111
-i3: 1111111
-c: 1111111111111111
-b: 1111111
-s: 111111111111111
-blb: 110101
-bls: 10111110101111
-bli: 101111101011111010111110101111
-bll: 101111101011111010111110101111
-```
-
-在文本值的后面添加字面值常量可以让编译器识别该文本值的类型。对于 **Long** 型数值,结尾使用大写 `L` 或小写 `l` 皆可(不推荐使用 `l`,因为容易与阿拉伯数值 1 混淆)。大写 `F` 或小写 `f` 表示 **float** 浮点数。大写 `D` 或小写 `d` 表示 **double** 双精度。
-
-
-十六进制(以 16 为基数),适用于所有整型数据类型,由前导 `0x` 或 `0x` 表示,后跟 0-9 或 a-f (大写或小写)。如果我们在初始化某个类型的数值时,赋值超出其范围,那么编译器会报错(不管值的数字形式如何)。在上例的代码中,**char**、**byte** 和 **short** 的值已经是最大了。如果超过这些值,编译器将自动转型为 **int**,并且我们需要声明强制转换(强制转换将在本章后面定义)。这告诉我们已越过该类型的范围界限。
-
-八进制(以 8 为基数)由 0~7 之间的数字和前导零 `0` 表示。
-
-Java 7 引入了二进制的字面值常量,由前导 `0B` 或 `0B` 表示,它可以初始化所有的整数类型。
-
-使用整型数值类型时,显示其二进制形式会很有用。在 Long 型和 Integer 型中这很容易实现,调用其静态的 **toBinaryString()** 方法即可。 但是请注意,若将较小的类型传递给 **Integer.tobinarystring()** 时,类型将自动转换为 **int**。
-
-
-### 下划线
-
-
-Java 7 中有一个深思熟虑的补充:我们可以在数字文字中包含下划线 `_`,以使结果更清晰。这对于大数值的分组数字特别有用。代码示例:
-
-
-```JAVA
-// operators/Underscores.java
-public class Underscores {
- public static void main(String[] args) {
- double d = 341_435_936.445_667;
- System.out.println(d);
- int bin = 0b0010_1111_1010_1111_1010_1111_1010_1111;
- System.out.println(Integer.toBinaryString(bin));
- System.out.printf("%x%n", bin); // [1]
- long hex = 0x7f_e9_b7_aa;
- System.out.printf("%x%n", hex);
- }
-}
-```
-
-输出结果:
-
-```
-3.41435936445667E8
-101111101011111010111110101111
-2fafafaf
-7fe9b7aa
-```
-
-
-下面是合理使用的规则:
-
-1. 仅限单 `_`,不能多条相连。
-2. 数值开头和结尾不允许出现 `_`。
-3. `F`、`D` 和 `L`的前后禁止出现 `_`。
-4. 二进制前导 `b` 和 十六进制 `x` 前后禁止出现 `_`。
-
-
-[1] 注意 `%n`的使用。熟悉 C 风格的程序员可能习惯于看到 `\n` 来表示换行符。问题在于它给你的是一个“Unix风格”的换行符。此外,如果我们使用的是 Windows,则必须指定 `\r\n`。这种差异的包袱应该由编程语言来解决。这就是Java用 `%n` 实现的,忽略平台间差异生成适当的换行符。但当你使用 `System.out.printf()` 或 `System.out.format()` 时。对于 `System.out.println()`,我们仍然必须使用 `\n`;如果你使用 `%n`,`println()` 只会输出 `%n` 而不是换行符。
-
-
-
-### 指数计数法
-
- 指数总是采用一种我认为很不直观的记号方法:
-
-```JAVA
-// operators/Exponents.java
-// "e" 表示 10 的几次幂
-public class Exponents {
- public static void main(String[] args) {
- // 大写 E 和小写 e 的效果相同:
- float expFloat = 1.39e-43f;
- expFloat = 1.39E-43f;
- System.out.println(expFloat);
- double expDouble = 47e47d; // 'd' 是可选的
- double expDouble2 = 47e47; // 自动转换为 double
- System.out.println(expDouble);
- }
-}
-```
-
-输出结果:
-
-```
-1.39E-43
-4.7E48
-```
-
-在科学与工程学领域,“e”代表自然对数的基数,约等于 2.718 (Java 一种更精确的 **double** 值采用 **Math.E** 的形式)。它在类似 “1.39×e 的 -47 次方”这样的指数表达式中使用,意味着“1.39×2.718 的-47次方”。然而,自 FORTRAN 语言发明后,人们自然而然地觉得e 代表 “10几次幂”。这种做法显得颇为古怪,因为 FORTRAN 最初面向的是科学与工程设计领域。
-
-理所当然,它的设计者应对这样的混淆概念持谨慎态度 [^2]。但不管怎样,这种特别的表达方法在 C,C++ 以及现在的 Java 中顽固地保留下来了。所以倘若习惯 e 作为自然对数的基数使用,那么在 Java 中看到类似“1.39e-47f”这样的表达式时,请转换你的思维,从程序设计的角度思考它;它真正的含义是“1.39×10 的-47次方”。
-
-注意如果编译器能够正确地识别类型,就不必使用尾随字面值常量。对于下述语句:
-
-```JAVA
-long n3 = 200;
-```
-
-它并不存在含糊不清的地方,所以 200 后面的 L 大可省去。然而,对于下述语句:
-
-```
-float f4 = 1e-47f; //10 的幂数
-```
-
-编译器通常会将指数作为 **double** 类型来处理,所以假若没有这个尾随的 `f`,编辑器就会报错,提示我们应该将 **double** 型转换成 **float** 型。
-
-
-
-## 按位运算符
-
-
-
-## 移位运算符
-
-
-
-## 三元运算符
-
-
-
-## 字符串运算符
-
-
-
-## 常见陷阱
-
-
-
-## 类型转换
-
-
-
-## Java没有sizeof
-
-
-
-## 运算符总结
-
-
-
-## 本章小结
-
-
-
-
diff --git a/book/05-Control-Flow.md b/book/05-Control-Flow.md
deleted file mode 100644
index 10fac11..0000000
--- a/book/05-Control-Flow.md
+++ /dev/null
@@ -1,789 +0,0 @@
-[TOC]
-
-# 第五章 控制流
-
-> 程序操纵它的世界并做出选择。 在Java中,您可以使用执行控制语句进行选择。
-
-Java 使用 C 的所有执行控制语句,因此如果您使用 C 或 C++ 进行编程,那么您所看到的大部分内容都是熟悉的。 大多数过程编程语言都有某种控制语句,并且语言之间经常存在重叠。在 Java 中,关键字包括 **if-else,while,do-while,for,return,break** 和名为 **switch** 的选择语句。 但是,Java 并不支持备受诟病的 **goto**(它仍然是解决某些类型问题的最有效方法)。 你仍然可以进行类似goto的跳转,但它比其他语言中的 **goto** 更受限制。
-
-[TOC]
-
-## true和flase
-
-条件表达式的示例是 **a == b**。这里有一个条件表达式示例,它使用条件操作符 **==** 来查看 **a** 的值是否等于 **b** 的值。 表达式返回 **true** 或 **false**。 如果显示条件表达式的结果,则会生成表示布尔值的字符串 **true** 和 **false**。
-
-```java
-// control/TrueFalse.java
-public class TrueFalse {
- public static void main(String[] args) {
- System.out.println(1 == 1);
- System.out.println(1 == 2);
- }
-}
-/* Output:
-true false */
-```
-
-您在上一章中看到的任何关系运算符都可以生成条件语句。 请注意,Java 不允许您使用数字作为布尔值,即使它在 C 和 C++ 中允许(在这些语言中,“真”为非零,而“假”是零)。如果想在布尔测试中使用非布尔值,例如**if (a)**,必须首先使用一个条件表达式将其转换为布尔值,例如 **if (a!= 0)**。
-
-## if-else
-
-**if-else** 语句是控制程序流程的最基本的形式。 其中的 **else** 是可选的,因此您可以使用两种形式的 **if**:
-
-```java
-if(Boolean-expression)
- statement
-```
-
-或
-
-```java
-if(Boolean-expression)
- statement
-else
- statement
-```
-
-布尔表达式必须生成布尔结果,statement 指用分号结尾的简单语句,或复合语句——封闭在花括号内的一组简单语句。 每当使用 “statement” 一词时,它总是暗示语句可以是简单的或复合的。
-
-作为 **if-else** 的一个例子,下面这个 **test()** 方法可以告诉您,您猜的数大于、小于还是等于目标数:
-
-```java
-// control/IfElse.java
-public class IfElse {
- static int result = 0;
- static void test(int testval, int target) {
- if(testval > target)
- result = +1;
- else if(testval < target) // [1]
- result = -1;
- else
- result = 0; // Match
- }
- public static void main(String[] args) {
- test(10, 5);
- System.out.println(result);
- test(5, 10);
- System.out.println(result);
- test(5, 5);
- System.out.println(result);
- }
-}
-/* Output:
-1
--1
-0
-*/
-```
-
-**[1]** “else if” 不是新关键字,只是一个 else 后跟一个新的 if 语句。
-
-尽管 Java(如之前的 C 和 C++)是一种“自由格式”语言,但通常会缩进控件流语句的主体,以便读者可以轻松确定它的开始和结束位置。
-
-
-
-## 迭代语句
-
-循环由 **while**,**do-while** 和 **for** 控制,有时称为迭代语句。 语句会重复执行,直到起控制作用的 **布尔表达式** (Boolean expression)计算为“假”。
-
-
-### while
-
-while循环的形式是:
-
-```java
-while(Boolean-expression)
- statement
-```
-
-在循环开始时,会计算一次布尔表达式的值,而在语句的每次进一步迭代之前再次计算一次。
-
-下面这个简单的例子将可产生随机数,直到满足特定条件:
-
-```java
-// control/WhileTest.java
-
-public class WhileTest {
- static boolean condition() {
- boolean result = Math.random() < 0.99;
- System.out.print(result + ", ");
- return result;
- }
- public static void main(String[] args) {
- while(condition())
- System.out.println("Inside 'while'");
- System.out.println("Exited 'while'");
- }
-}
-/* Output: (First and Last 5 Lines)
-true, Inside 'while'
-true, Inside 'while'
-true, Inside 'while'
-true, Inside 'while'
-true, Inside 'while'
-...________...________...________...________...
-true, Inside 'while'
-true, Inside 'while'
-true, Inside 'while'
-true, Inside 'while'
-false, Exited 'while'
-*/
-```
-
-**condition()** 方法用到了 **Math** 库里的 **static** (静态)方法 **random()**,该方法的作用是产生 0 和 1 之间 (包括 0,但不包括 1) 的一个**double**值。**result** 的值是通过比较操作符<而得到它的,这个操作符产生 **boolean** 类型的结果。在打印 **boolean** 类型的值时,将自动地得到适合的字符串 **true** 或 **false**。while 的条件表达式意思是说:“只要 **condition()**返回 **true**,就重复执行循环体中的语句”。
-
-### do-while
-
-**do-while** 的格式如下:
-
-```java
-do
- statement
-while(Boolean-expression);
-```
-
-**while** 和 **do-while** 之间的唯一区别是 **do-while** 的语句总是至少执行一次,即使表达式第一次计算为 false 也是如此。 在 **while** 循环结构中,如果条件第一次就为 **false**,那么其中的语句根本不会执行。在实际应用中,**while** 比 **do-while** 更常用一点。
-
-### for
-
-**for** 循环可能是最常用的迭代形式。 该循环在第一次迭代之前执行初始化。 随后,它会执行条件测试,并在每次迭代结束时,进行某种形式的“步进”。**for** 循环的形式是:
-
-```java
-for(initialization; Boolean-expression; step)
- statement
-```
-
-初始化 (initialization) 表达式、布尔表达式 (Boolean-expression) ,或者步进 (step) 运算,都可以为空。在每次迭代之前都会测试表达式,并且一旦计算结果为 false,就会在 for 语句后面的行继续执行。 在每个循环结束时,执行一次步进。
-
-**for**循环通常用于“计数”任务:
-
-```java
-// control/ListCharacters.java
-
-public class ListCharacters {
- public static void main(String[] args) {
- for(char c = 0; c < 128; c++)
- if(Character.isLowerCase(c))
- System.out.println("value: " + (int)c +
- " character: " + c);
- }
-}
-/* Output: (First 10 Lines)
-value: 97 character: a
-value: 98 character: b
-value: 99 character: c
-value: 100 character: d
-value: 101 character: e
-value: 102 character: f
-value: 103 character: g
-value: 104 character: h
-value: 105 character: i
-value: 106 character: j
-...
-*/
-```
-
-请注意,变量 **c** 在程序用到它的地方被定义的,也就是在for循环的控制表达式内,而不是在 **main()** 的开头。**c** 的范围是由 **for** 控制的语句。
-
-像C这样的传统过程语言要求在块的开头定义所有变量。 当编译器创建块时,它可以为这些变量分配空间。 在Java和C ++中,您可以在整个块中传播变量声明,并在需要时定义它们。 这允许更自然的编码风格并使代码更容易理解。[1]
-
-这个程序也使用了 **java.lang.Character** 包装器类,这个类不但能把 **char** 基本类型的值包装进对象,还提供了一些别的有用的方法。这里用到了 **static isLowerCase()** 方法来检查问题中的字符是否为小写字母。
-
-
-
-#### 逗号操作符
-
-逗号运算符(不是逗号分隔符,逗号作为分隔符用于分隔定义和方法参数)在 Java 中只有一个用法:在**for** 循环的控制表达式中。 在控制表达式的初始化和步进控制中,您可以使用逗号分隔多个语句,并按顺序计算这些语句。使用逗号运算符,您可以在 **for** 语句中定义多个变量,但它们必须属于同一类型:
-
-```java
-// control/CommaOperator.java
-
-public class CommaOperator {
- public static void main(String[] args) {
- for(int i = 1, j = i + 10; i < 5; i++, j = i * 2) {
- System.out.println("i = " + i + " j = " + j);
- }
- }
-}
-/* Output:
-i = 1 j = 11
-i = 2 j = 4
-i = 3 j = 6
-i = 4 j = 8
-*/
-```
-
-**for** 语句中的 **int** 定义覆盖了 **i** 和 **j**,在初始化部分实际上可以拥有任意数量的具有相同类型的变量定义。在控制表达式中定义变量的能力仅限于 **for** 循环。 您不能将此方法与任何其他选择或迭代语句一起使用。
-
-可以看到,无论在初始化还是在步进部分,语句都是顺序执行的。
-
-## for-in语法
-
-Java 5引入了更简洁的 **for** 语法,用于数组和集合(您将在“数组和集合”章节中了解更多有关这些内容的信息)。 这有时被称为 **增强版for循环**,并且您将看到的大部分文档称为 *for-each* 语法,但Java 8添加了大量使用的 **forEach()**。 这会混淆术语,因此我称之为*for-in* (例如,在Python中,你实际上是 **for x in sequence**,所以有合理的先例)。 请记住,您可能会在其他地方看到它的不同叫法。
-
-**for-in** 会自动为您生成每个项,因此你不必创建 **int** 变量去对由访问项构成的序列进行计数。 例如,假设您有一个 **float** 数组,并且您想要选取该数组中的每个元素:
-
-```java
-// control/ForInFloat.java
-
-import java.util.*;
-
-public class ForInFloat {
- public static void main(String[] args) {
- Random rand = new Random(47);
- float[] f = new float[10];
- for(int i = 0; i < 10; i++)
- f[i] = rand.nextFloat();
- for(float x : f)
- System.out.println(x);
- }
-}
-/* Output:
-0.72711575
-0.39982635
-0.5309454
-0.0534122
-0.16020656
-0.57799757
-0.18847865
-0.4170137
-0.51660204
-0.73734957
-*/
-```
-
-这个数组是用旧式的for循环组装的,因为在组装时必须按索引访问它。在下面这行中可以看到foreach方法:
-
-```java
-for(float x : f) {
-```
-
-这条语句定义了一个 **float** 类型的变量 **x**,继而将每一个 **f** 的元素赋值给 **x**。
-
-任何返回一个数组的方法都可以使用 **for-in**。例如 **String** 类有一个方法 **toCharArray()**,它返回一个 **char** 数组,因此可以很容易地下像下面这样迭代在字符串里面的所有字符:
-
-```java
-// control/ForInString.java
-
-public class ForInString {
- public static void main(String[] args) {
- for(char c : "An African Swallow".toCharArray())
- System.out.print(c + " ");
- }
-}
-/* Output:
-A n A f r i c a n S w a l l o w
-*/
-```
-
-就像在集合的章节所看到的,for-in还可以用于任何 **iterable** 对象。
-
-许多 **for** 语句都会在一个整型值序列中步进,就像下面这样:
-
-```java
-for(int i = 0; i < 100; i++)
-```
-
-对于这样的语句,for-in语法将不起作用,除非先创建一个 **int** 数组。为了简化这些任务,我会在**onjava.Range** 包中创建一个名为 **range()** 的方法,它将自动生成恰当的数组。
-
-隐藏实施过程这一章节( Implementation Hiding )介绍了静态导入。 但是,您无需了解这些详细信息即可开始使用此库。 你可以在 **import** 语句中看到 **static import** 语法:
-
-```java
-// control/ForInInt.java
-
-import static onjava.Range.*;
-
-public class ForInInt {
- public static void main(String[] args) {
- for(int i : range(10)) // 0..9
- System.out.print(i + " ");
- System.out.println();
- for(int i : range(5, 10)) // 5..9
- System.out.print(i + " ");
- System.out.println();
- for(int i : range(5, 20, 3)) // 5..20 step 3
- System.out.print(i + " ");
- System.out.println();
- for(int i : range(20, 5, -3)) // Count down
- System.out.print(i + " ");
- System.out.println();
- }
-}
-/* Output:
-0 1 2 3 4 5 6 7 8 9
-5 6 7 8 9
-5 8 11 14 17
-20 17 14 11 8
-*/
-```
-
-**range()** 方法已经被重载,重载表示相同的方法名可以具有不同的参数列表(你将很快学习重载)。**range()** 的第一个种重载形式是从0开始产生值,直到范围的上限,但不包括该上限。第二种重载形式是从第一个值开始产生值,直至比第二值小1的值为止。第三种形式有一个步进值,因此它每次的增量为该值。第四种 **range()** 表明还可以递减。**range()**是所谓生成器的一个非常简单的版本,有关生成器的内容将在本书稍后进行介绍。
-
-**range()** 允许在更多地方使用 for-in 语法,因此可以说提高可读性。
-
-请注意,**System.out.print()** 不会输出换行符,因此您可以分段输出一行。
-
-*for-in* 语法不仅可以节省编写代码的时间。 更重要的是,它更容易阅读并说明你要做什么(获取数组的每个元素)而不是详细说明你是如何做到的(“我正在创建这个索引,所以我可以使用它来选择每个数组元素。“)。 本书只要有可能就会使用 *for-in* 语法。
-
-## return
-
-在Java中有几个关键字代表无条件分支,这意味着分支在没有任何测试的情况下发生。 这些包括**return**,**break**,**continue** 和跳转到带标签语句的方法,类似于其他语言中的 **goto**。
-
-**return**关键字有两方面的用途:一方面指定一个方法返回什么值(假设它没有 **void** 返回值),另一方面它会导致当前的方法退出,并返回那个值。可据此改写上面的 **IfElse.java** 里的 **test()** 方法,使其利用这些特点:
-
-```java
-// control/TestWithReturn.java
-
-public class TestWithReturn {
- static int test(int testval, int target) {
- if(testval > target)
- return +1;
- if(testval < target)
- return -1;
- return 0; // Match
- }
- public static void main(String[] args) {
- System.out.println(test(10, 5));
- System.out.println(test(5, 10));
- System.out.println(test(5, 5));
- }
-}
-/* Output:
-1
--1
-0
-*/
-```
-
-不需要 **else**,因为该方法在执行返回后不会继续执行。
-
-如果在返回 **void** 的方法中没有 **return** 语句,则在该方法结束时会有一个隐式的 **return**,因此一个方法中并不总是需要包含 **return** 语句。 但是,如果您的方法声明它将返回除 **void** 之外的任何返回类型,则必须确保每个代码路径都返回一个值。
-
-## break和continue
-
-在任何迭代语句的主体部分,都可以使用 **break** 和 **continue** 来控制循环的流程。 其中,**break** 退出循环而不执行循环中的其余语句。 而 **continue** 停止执行当前的迭代,然后退回循环起始处,以开始下一次迭代。
-
-下面这个程序向大家展示了 **break** 和 **continue** 在 **for** 和 **while** 循环中的例子:
-
-```java
-// control/BreakAndContinue.java
-// Break and continue keywords
-
-import static onjava.Range.*;
-
-public class BreakAndContinue {
- public static void main(String[] args) {
- for(int i = 0; i < 100; i++) { // [1]
- if(i == 74) break; // Out of for loop
- if(i % 9 != 0) continue; // Next iteration
- System.out.print(i + " ");
- }
- System.out.println();
- // Using for-in:
- for(int i : range(100)) { // [2]
- if(i == 74) break; // Out of for loop
- if(i % 9 != 0) continue; // Next iteration
- System.out.print(i + " ");
- }
- System.out.println();
- int i = 0;
- // An "infinite loop":
- while(true) { // [3]
- i++;
- int j = i * 27;
- if(j == 1269) break; // Out of loop
- if(i % 10 != 0) continue; // Top of loop
- System.out.print(i + " ");
- }
- }
-}
-/* Output:
-0 9 18 27 36 45 54 63 72
-0 9 18 27 36 45 54 63 72
-10 20 30 40
-*/
-```
-
-**[1]** 在这个 **for** 循环中,**i** 的值永远不会达到 100;因为一旦 **i** 达到 74,**break** 语句就会中断循环。通常,只有在不知道中断条件何时满足时,才需要这样使用 **break**。因为**i** 不能被 9 整除,**continue** 语句就会使执行过程返回到循环的最开头(这使 **i** 递增)。如果能够整除,则将值显示出来。
-
-**[2]** 使用 for-in 语法将产生相同的结果。
-
-**[3]** 最后,可以看到一个“无穷 **while** 循环”的情况。然而,循环内部有一个 **break** 语句,可中止循环。请注意,**continue** 语句将控制权移回循环的顶部,而不会执行 **continue** 之后的任何操作。 因此,只有当 i 的值可被 10 整除时才会显示。在输出中,显示值 0,因为 0%9 产生0。
-
-无限循环的另一种形式是 **for(;;)**。 编译器以同样的方式处理 **while(true)** 和 **for(;;)**,因此使用哪种取决于编程品味。
-
-
-
-## 臭名昭著的goto
-
-goto 关键字很早就在程序设计语言中出现。事实上,goto 是汇编语言的程序控制结构的始祖:“若条件A,则跳到这里;否则跳到那里”。若阅读由几乎所有编译器生成的汇编代码,就会发现程序控制里包含了许多跳转。然而,goto是在源码的级别跳转的,所以招致了不好的声誉。若程序总是从一个地方跳到另一个地方,还有什么办法能识别代码的流程呢?随着 Edsger Dijkstra 著名的 “Goto 有害” 论的问世,goto 便从此失宠。
-
-事实上,真正的问题并不在于使用 goto,而在于 goto 的滥用。而且在一些少见的情况下,goto 是组织控制流程的最佳手段。
-
-尽管 goto 仍是 Java 的一个保留字,但并未在语言中得到正式使用;Java 没有 goto。然而,在 break和 continue 这两个关键字的身上,我们仍然能看出一些goto的影子。它并不属于一次跳转,而是中断循环语句的一种方法。之所以把它们纳入 goto 问题中一起讨论,是由于它们使用了相同的机制:标签。
-
-“标签”是后面跟一个冒号的标识符,就像下面这样:
-
-```java
-label1:
-```
-
-对 Java 来说,唯一用到标签的地方是在循环语句之前。进一步说,它实际需要紧靠在循环语句的前方——在标签和循环之间置入任何语句都是不明智的。而在循环之前设置标签的唯一理由是:我们希望在其中嵌套另一个循环或者一个开关。这是由于 break 和 continue 关键字通常只中断当前循环,但若随同标签使用,它们就会中断到存在标签的地方。如下所示:
-
-```java
-label1:
-outer-iteration {
- inner-iteration {
- // ...
- break; // [1]
- // ...
- continue; // [2]
- // ...
- continue label1; // [3]
- // ...
- break label1; // [4]
- }
-}
-```
-
-**[1]** **break** 中断内部循环,并在外部循环结束。
-
-**[2]** **continue** 移回内部循环的起始处。但在条件3中,**continue label1** 却同时中断内部循环以及外部循环,并移至 **label1** 处。
-
-**[3]** 随后,它实际是继续循环,但却从外部循环开始。
-
-**[4]** **break label1** 也会中断所有循环,并回到 **label1** 处,但并不重新进入循环。也就是说,它实际是完全中止了两个循环。
-
-下面是 for 循环的一个例子:
-
-```java
-// control/LabeledFor.java
-// For loops with "labeled break"/"labeled continue."
-
-public class LabeledFor {
- public static void main(String[] args) {
- int i = 0;
- outer: // Can't have statements here
- for(; true ;) { // infinite loop
- inner: // Can't have statements here
- for(; i < 10; i++) {
- System.out.println("i = " + i);
- if(i == 2) {
- System.out.println("continue");
- continue;
- }
- if(i == 3) {
- System.out.println("break");
- i++; // Otherwise i never
- // gets incremented.
- break;
- }
- if(i == 7) {
- System.out.println("continue outer");
- i++; // Otherwise i never
- // gets incremented.
- continue outer;
- }
- if(i == 8) {
- System.out.println("break outer");
- break outer;
- }
- for(int k = 0; k < 5; k++) {
- if(k == 3) {
- System.out.println("continue inner");
- continue inner;
- }
- }
- }
- }
- // Can't break or continue to labels here
- }
-}
-/* Output:
-i = 0
-continue inner
-i = 1
-continue inner
-i = 2
-continue
-i = 3
-break
-i = 4
-continue inner
-i = 5
-continue inner
-i = 6
-continue inner
-i = 7
-continue outer
-i = 8
-break outer
-*/
-```
-
-注意 **break** 会中断 **for** 循环,而且在抵达 **for** 循环的末尾之前,递增表达式不会执行。由于 **break** 跳过了递增表达式,所以递增会在 **i==3** 的情况下直接执行。在 **i==7** 的情况下,**continue outer** 语句也会到达循环顶部,而且也会跳过递增,所以它也是直接递增的。
-
-如果没有 **break outer** 语句,就没有办法在一个内部循环里找到出外部循环的路径。这是由于 **break** 本身只能中断最内层的循环(对于 **continue** 同样如此)。 当然,若想在中断循环的同时退出方法,简单地用一个 **return** 即可。
-
-下面这个例子向大家展示了带标签的 **break** 以及 **continue** 语句在 **while** 循环中的用法:
-
-```java
-// control/LabeledWhile.java
-// "While" with "labeled break" and "labeled continue."
-
-public class LabeledWhile {
- public static void main(String[] args) {
- int i = 0;
- outer:
- while(true) {
- System.out.println("Outer while loop");
- while(true) {
- i++;
- System.out.println("i = " + i);
- if(i == 1) {
- System.out.println("continue");
- continue;
- }
- if(i == 3) {
- System.out.println("continue outer");
- continue outer;
- }
- if(i == 5) {
- System.out.println("break");
- break;
- }
- if(i == 7) {
- System.out.println("break outer");
- break outer;
- }
- }
- }
- }
-}
-/* Output:
-Outer while loop
-i = 1
-continue
-i = 2
-i = 3
-continue outer
-Outer while loop
-i = 4
-i = 5
-break
-Outer while loop
-i = 6
-i = 7
-break outer
-*/
-```
-
-同样的规则亦适用于 **while**:
-
-(1) 简单的一个 **continue** 会退回最内层循环的开头(顶部),并继续执行。
-
-(2) 带有标签的 **continue** 会到达标签的位置,并重新进入紧接在那个标签后面的循环。
-
-(3) **break** 会中断当前循环,并移离当前标签的末尾。
-
-(4) 带标签的 **break** 会中断当前循环,并移离由那个标签指示的循环的末尾。
-
-大家要记住的重点是:在 Java 里需要使用标签的唯一理由就是因为有循环嵌套存在,而且想从多层嵌套中 **break** 或 **continue**。
-
-**break** 和 **continue** 标签已经成为相对少用的推测特征(在前面的语言中很少或没有先例),所以你很少在代码里看到它们。
-
-在 **Dijkstra** 的 **“goto 有害”** 论中,他最反对的就是标签,而非 **goto**。随着标签在一个程序里数量的增多,他发现产生错误的机会也越来越多。标签和 **goto** 使我们难于对程序作静态分析。但是,Java 标签不会造成这方面的问题,因为它们的应用场合已经收到了限制,没有特别的方式用于概念程序的控制。由此也引出了一个有趣的问题:通过限制语句的能力,反而能使一项语言特性更加有用。
-
-## switch
-
-**switch** 有时也被划归为一种选择语句。根据整数表达式的值,**switch** 语句可以从一系列代码中选出一段去执行。它的格式如下:
-
-```java
-switch(integral-selector) {
- case integral-value1 : statement; break;
- case integral-value2 : statement; break;
- case integral-value3 : statement; break;
- case integral-value4 : statement; break;
- case integral-value5 : statement; break;
- // ...
- default: statement;
-}
-```
-
-其中,integral-selector (整数选择因子)是一个能够产生整数值的表达式,**switch** 能够将这个表达式的结果与每个 integral-value (整数值)相比较。若发现相符的,就执行对应的语句(简单或复合语句,其中并不需要括号)。若没有发现相符的,就执行 default 语句。
-
-在上面的定义中,大家会注意到每个 **case** 均以一个 **break** 结尾。这样可使执行流程跳转至 switch 主体的末尾。这是构建 **switch** 语句的一种传统方式,但 **break** 是可选的。若省略 break, 会继续执行后面的 **case** 语句的代码,直到遇到一个 **break** 为止。尽管通常不想出现这种情况,但对有经验的程序员来说,也许能够善加利用。注意最后的 **default** 语句没有 **break**,因为执行流程已到了break的跳转目的地。当然,如果考虑到编程风格方面的原因,完全可以在**default** 语句的末尾放置一个 **break**,尽管它并没有任何实际的用处。
-
-switch 语句是实现多路选择的一种干净利落的一种方式(比如从一系列执行路径中挑选一个)。但它要求使用一个选择因子,并且必须是 int 或 char 那样的整数值。例如,假若将一个字串或者浮点数作为选择因子使用,那么它们在 switch 语句里是不会工作的。对于非整数类型,则必须使用一系列 if 语句。
-
-下面这个例子可随机生成字母,并判断它们是元音还是辅音字母:
-
-```java
-// control/VowelsAndConsonants.java
-
-// Demonstrates the switch statement
-import java.util.*;
-
-public class VowelsAndConsonants {
- public static void main(String[] args) {
- Random rand = new Random(47);
- for(int i = 0; i < 100; i++) {
- int c = rand.nextInt(26) + 'a';
- System.out.print((char)c + ", " + c + ": ");
- switch(c) {
- case 'a':
- case 'e':
- case 'i':
- case 'o':
- case 'u': System.out.println("vowel");
- break;
- case 'y':
- case 'w': System.out.println("Sometimes vowel");
- break;
- default: System.out.println("consonant");
- }
- }
- }
-}
-/* Output: (First 13 Lines)
-y, 121: Sometimes vowel
-n, 110: consonant
-z, 122: consonant
-b, 98: consonant
-r, 114: consonant
-n, 110: consonant
-y, 121: Sometimes vowel
-g, 103: consonant
-c, 99: consonant
-f, 102: consonant
-o, 111: vowel
-w, 119: Sometimes vowel
-z, 122: consonant
-...
-*/
-```
-
-由于 **Random.nextInt(26)** 会产生 0 到 26 之间的一个值,所以在其上加上一个偏移量 "a",即可产生小写字母。在 **case** 语句中,使用单引号引起的字符也会产生用于比较的整数值。
-
-请注意 **case** 语句能够堆叠在一起,为一段代码形成多重匹配,即只要符合多种条件中的一种,就执行那段特别的代码。这时也应该注意将 **break** 语句置于特定 **case** 的末尾,否则控制流程会简单地下移,处理后面的 **case**。
-
-在下面的语句中:
-
-```java
-int c = rand.nextInt(26) + 'a';
-```
-
-此处 **Random.nextInt()** 将产生 0~25 之间的一个随机 **int** 值,它将被加到 **a** 上。这表示 **a** 将自动被转换为 **int** 以执行假发。为了把 **c** 当作字符打印,必须将其转型为 **char**;否则,将产生整数输出。
-
-
-
-## switch字符串
-
-Java 7 增加了在字符串上 **switch** 的用法。 此示例展示了您从一组 String 可能性中选择的旧方法,以及使用 switch 的新方法:
-
-```java
-// control/StringSwitch.java
-
-public class StringSwitch {
- public static void main(String[] args) {
- String color = "red";
- // Old way: using if-then
- if("red".equals(color)) {
- System.out.println("RED");
- } else if("green".equals(color)) {
- System.out.println("GREEN");
- } else if("blue".equals(color)) {
- System.out.println("BLUE");
- } else if("yellow".equals(color)) {
- System.out.println("YELLOW");
- } else {
- System.out.println("Unknown");
- }
- // New way: Strings in switch
- switch(color) {
- case "red":
- System.out.println("RED");
- break;
- case "green":
- System.out.println("GREEN");
- break;
- case "blue":
- System.out.println("BLUE");
- break;
- case "yellow":
- System.out.println("YELLOW");
- break;
- default:
- System.out.println("Unknown");
- break;
- }
- }
-}
-/* Output:
-RED
-RED
-*/
-```
-
-一旦理解了 switch,这种语法就是一个逻辑扩展。 结果更清晰,更易于理解和维护。
-
-作为 **switch** 字符串的第二个例子,我们重新访问 Math.random()。 它是否产生从 0 到 1 的值,包括还是不包括值 “1”? 在数学术语中,是(0,1),还是 [0,1],还是(0,1)还是 [0,1]? (方括号表示“包括”,而括号表示“不包括”。)
-
-下面一个可能提供答案的测试程序。 所有命令行参数都作为 **String** 对象传递,因此我们可以 **switch** 参数来决定要做什么。 有一个问题:用户可能不提供任何参数,因此索引到 args 数组会导致程序失败。 要解决这个问题,我们检查数组的长度,如果它为零,我们使用一个空字符串,否则我们选择 **args** 数组中的第一个元素:
-
-```java
-// control/RandomBounds.java
-
-// Does Math.random() produce 0.0 and 1.0?
-// {java RandomBounds lower}
-import onjava.*;
-
-public class RandomBounds {
- public static void main(String[] args) {
- new TimedAbort(3);
- switch(args.length == 0 ? "" : args[0]) {
- case "lower":
- while(Math.random() != 0.0)
- ; // Keep trying
- System.out.println("Produced 0.0!");
- break;
- case "upper":
- while(Math.random() != 1.0)
- ; // Keep trying
- System.out.println("Produced 1.0!");
- break;
- default:
- System.out.println("Usage:");
- System.out.println("\tRandomBounds lower");
- System.out.println("\tRandomBounds upper");
- System.exit(1);
- }
- }
-}
-```
-
-要运行该程序,请键入以下任一命令:
-
-```java
-java RandomBounds lower
-or
-java RandomBounds upper
-```
-
-使用 onjava 包中的 TimedAbort 类,程序在三秒后中止,因此看起来 Math.random() 从不生成 0.0 或 1.0。 但这就是这样一个实验可以欺骗的地方。 如果考虑0到1之间所有不同 **double** 类型的分数(double fractions)的数量,实验中达到任何一个值的可能性可能超过一台计算机甚至一个实验者的寿命。 结果是 0.0 包含在 **Math.random()** 的输出中,而 1.0 则不包括在内。 在数学术语中,它是 [0,1)。 您必须小心分析您的实验并了解它们的局限性。结果是 0.0 包含在 **Math.random()** 的输出中,而 1.0 则不包括在内。 在数学术语中,它是 [0,1)。 您必须小心分析您的实验并了解它们的局限性。
-
-
-
-## 本章小结
-
-本章总结了我们对大多数编程语言中出现的基本特征的探索:计算,运算符优先级,类型转换,选择和迭代。 现在,您已准备好开始采取措施,使您更接近面向对象和函数式编程的世界。 下一章将介绍初始化和清理对象的重要问题,接下来的章节将介绍隐藏实现细节(implementation hiding)的这一核心概念。
-
-
-
-1. 在早期的语言中,大量的决策都是基于使编译器编写者的生活更轻松。 你会发现,在现代语言中,大多数设计决策都会让语言用户的生活更轻松,尽管有时会有妥协 - 这通常会让语言设计师感到后悔。
-
-2. 请注意,这似乎是一个难以支持的主张,并且很可能是称为相关因果关系谬误的认知偏差的一个例子。
-
-
-
-
\ No newline at end of file
diff --git a/book/08-Reuse.md b/book/08-Reuse.md
deleted file mode 100644
index d8b7a69..0000000
--- a/book/08-Reuse.md
+++ /dev/null
@@ -1,49 +0,0 @@
-[TOC]
-
-
-# 第八章 复用
-
-
-
-## 组合语法
-
-
-
-## 继承语法
-
-
-
-## 委托
-
-
-
-## 结合组合与继承
-
-
-
-## 组合与继承的选择
-
-
-
-## protected
-
-
-
-## 向上转型
-
-
-
-## final关键字
-
-
-
-## 类初始化和加载
-
-
-
-## 本章小结
-
-
-
-
-
diff --git a/book/14-Streams.md b/book/14-Streams.md
deleted file mode 100644
index 5f8bd2f..0000000
--- a/book/14-Streams.md
+++ /dev/null
@@ -1,32 +0,0 @@
-[TOC]
-
-
-# 第十四章 流式编程
-
-
-
-## 流支持
-
-
-
-## 流创建
-
-
-
-## 中级流操作
-
-
-
-## Optional类
-
-
-
-## 终端操作
-
-
-
-## 本章小结
-
-
-
-
\ No newline at end of file
diff --git a/book/Appendix-New-IO.md b/book/Appendix-New-IO.md
deleted file mode 100644
index da0dee1..0000000
--- a/book/Appendix-New-IO.md
+++ /dev/null
@@ -1,998 +0,0 @@
-[TOC]
-
-
-# 附录:新IO
-
-
-Java “新” I/O 库,是在Java 1.4引入到 **Java .nio.* package** 中。它有一个目标 : 速度。
-
-实际上,“旧的”I/O包是使用 **nio** 重新实现了,因此速度也得到提升,因此即使不显式地使用nio 编写代码,也可以提速。这种速度的提高既发生在文件 I/O 中(这里讨论),也发生在网络I/O 中(例如用于Internet编程)。
-
-速度来自于使用更接近操作系统执行 I/O 方式的结构 : 通道和缓冲区。把它想象成一个煤矿;通道是包含煤层的矿井(数据),缓冲区是您发送到矿井的小车。车里装满了煤,你从车上拿煤。也就是说,你不能直接和通道互动 ; 您与缓冲区交互并将缓冲区发送到通道中。通道要么从缓冲区中提取数据,要么将数据放入缓冲区。
-
-本附录将深入探讨 nio 包。像I/O streams 这样的高级库使用 **nio**,但是大多数时候您不需要在这个级别使用 I/O 。在Java 7和Java 8,您(理想情况下)除了特殊情况外,甚至不需要使用I/O流。理想情况下,您将经常使用的所有内容都包含在文件一章中。只有在处理性能问题 (例如,可能需要内存映射文件)或创建自己的 I/O 库时,才需要理解 **nio**。
-
-
-## ByteBuffer
-
-
-直接与通道通信的缓冲区只有一个类型,就是 bytebuffer 。也就是说,一个保存原始字节的缓冲区。如果您查看 **java.nio.ByteBuffer** 的JDK文档,你会发现它很基本 : 您可以通过告诉它要分配多少存储空间来创建一个方法,并且可以使用一些方法来放置和获取数据,这些方法可以是原始字节形式的数据,也可以是原始数据类型的数据。但是没有办法放置或获取对象,甚至字符串。它是相当低层次的,因为这使得大多数操作系统的映射更加有效。
-
-“旧的” I/O 中的三个类被修改,可以生成一个 **FileChannel** 分别是: **FileInputStream**、**FileOutputStream**,以及用于读写的 **RandomAccessFile**。
-
-注意,这些是字节操作流,符合 **nio** 的底层特性。 字符模式类的 **Reader** 和 **Writer** 不生成通道,但通道类具有从通道生成 **Reader** 和 **Writer** 的实用方法。
-
-在这里,我们使用所有三种类型的流来生成可写、可读/可写和可读的通道:
-
-```java
-// (c)2017 MindView LLC: see Copyright.txt
-// We make no guarantees that this code is fit for any purpose.
-// Visit http://OnJava8.com for more book information.
-// Getting channels from streams
-import java.nio.*;
-import java.nio.channels.*;
-import java.io.*;
-
-public class GetChannel {
- private static String name = "data.txt";
- private static final int BSIZE = 1024;
- public static void main(String[] args) {
- // Write a file:
- try(
- FileChannel fc = new FileOutputStream(name)
- .getChannel()
- ) {
- fc.write(ByteBuffer
- .wrap("Some text ".getBytes()));
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- // Add to the end of the file:
- try(
- FileChannel fc = new RandomAccessFile(
- name, "rw").getChannel()
- ) {
- fc.position(fc.size()); // Move to the end
- fc.write(ByteBuffer
- .wrap("Some more".getBytes()));
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- // Read the file:
- try(
- FileChannel fc = new FileInputStream(name)
- .getChannel()
- ) {
- ByteBuffer buff = ByteBuffer.allocate(BSIZE);
- fc.read(buff);
- buff.flip();
- while(buff.hasRemaining())
- System.out.write(buff.get());
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- System.out.flush();
- }
-}
-/* Output:
-Some text Some more
-*/
-```
-
-对于这里显示的任何流类,**getChannel( )** 将生成一个 **FileChannel** 。通道是相当基本的:给它一个**ByteBuffer** 用于读写,并为独占访问锁定文件的区域(稍后将对此进行描述)。
-
-将字节放入 **ByteBuffer** 的一种方法是直接使用 “put” 方法,将一个或多个字节填入 ByteBuffer,当然也可以是其它原始类型。但是,正如这里所看到的,您还可以使用 **wrap()** 方法在 **ByteBuffer**中“包装”现有字节数组。执行此操作时,不会复制底层数组,而是将其用作生成的 **ByteBuffer** 的存储。这样生产的 **ByteBuffer** 是由数组“支持”的。
-
-data.txt 文件使用RandomAccessFile重新打开。注意,您可以在文件中移动 **FileChanne** l; 在这里,它被移动到末尾,以便添加额外的写操作。
-
-对于只读访问,必须使用 **static allocate()** 方法显式地分配 **ByteBuffer**。**nio** 的目标是快速移动大量数据,因此 **ByteBuffer** 的大小应该很重要——实际上,这里使用的1K可能比您通常使用的要小很多(您必须对工作应用程序进行试验,以找到最佳大小)。
-
-还可以通过使用 **allocateDirect()** 而不是 **allocation()** 来生成一个“直接”缓冲区来获得更快的速度,该缓冲区可以与操作系统进行更高的耦合。然而,这种分配的开销更大,而且实际实现因操作系统的不同而有所不同,因此,您必须再次试验您的工作应用程序,以发现直接缓冲区是否会为您带来速度上的优势。
-
-一旦您调用 **read()** 来告诉 **FileChannel** 将字节存储到 **ByteBuffer** 中,您必须调用缓冲区上的 **flip()**来告诉它准备好提取字节(是的,这看起来有点粗糙,但是请记住,这是非常低级的,而且是为了达到最高速度)。如果我们要为进一步的 **read()** 操作使用缓冲区,我们还将调用 **clear()** 为每个 **read()** 准备缓冲区。这个简单的文件复制程序演示:
-
-```java
-// newio/ChannelCopy.java
-
-// Copying a file using channels and buffers
-// {java ChannelCopy ChannelCopy.java test.txt}
-import java.nio.*;
-import java.nio.channels.*;
-import java.io.*;
-
-public class ChannelCopy {
- private static final int BSIZE = 1024;
- public static void main(String[] args) {
- if(args.length != 2) {
- System.out.println(
- "arguments: sourcefile destfile");
- System.exit(1);
- }
- try(
- FileChannel in = new FileInputStream(
- args[0]).getChannel();
- FileChannel out = new FileOutputStream(
- args[1]).getChannel()
- ) {
- ByteBuffer buffer = ByteBuffer.allocate(BSIZE);
- while(in.read(buffer) != -1) {
- buffer.flip(); // Prepare for writing
- out.write(buffer);
- buffer.clear(); // Prepare for reading
- }
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
-
-```
-
-打开一个 **FileChannel** 用于读取,另一个 **FileChannel** 用于写入。分配了一个 **ByteBuffer**,当**FileChannel.read() **返回 **-1** 时(毫无疑问,这是Unix和C语言中的一个剩余物 (holdover) ),意味着您已经完成了输入。每次 **read()** 将数据放入缓冲区之后,**flip()** 都会准备好缓冲区,以便 **write()** 提取它的信息。写()之后,信息仍然在缓冲区中,**clear()** 重置所有内部指针,以便在另一次 **read()** 期间接受数据。
-
-但是,前面的程序并不是处理这种操作的理想方法。特殊方法 transferTo() 和 transferFrom( )允许你直接连接一个通道到另一个:
-
-```java
-// newio/TransferTo.java
-
-// Using transferTo() between channels
-// {java TransferTo TransferTo.java TransferTo.txt}
-import java.nio.channels.*;
-import java.io.*;
-
-public class TransferTo {
- public static void main(String[] args) {
- if(args.length != 2) {
- System.out.println(
- "arguments: sourcefile destfile");
- System.exit(1);
- }
- try(
- FileChannel in = new FileInputStream(
- args[0]).getChannel();
- FileChannel out = new FileOutputStream(
- args[1]).getChannel()
- ) {
- in.transferTo(0, in.size(), out);
- // Or:
- // out.transferFrom(in, 0, in.size());
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
-```
-
-你不会经常这样做,但知道这一点很好。
-
-
-
-## 转换数据
-
-
-在 **GetChannel** 中打印文件中的信息。在 java 中,我们每次提取一个字节的数据,并将每个字节转换为 char。这看起来很简单——如果您查看**java.nio.CharBuffer** 类,您将看到它有一个toString()方法,该方法说,“返回一个包含这个缓冲区中的字符的字符串。”
-
-既然 **ByteBuffer** 可以用 **asCharBuffer()** 方法看作 **CharBuffer**,为什么不使用它呢? 从下面输出语句的第一行可以看出,这并不正确:
-
-```java
-// newio/BufferToText.java
-// (c)2017 MindView LLC: see Copyright.txt
-// We make no guarantees that this code is fit for any purpose.
-// Visit http://OnJava8.com for more book information.
-// Converting text to and from ByteBuffers
-import java.nio.*;
-import java.nio.channels.*;
-import java.nio.charset.*;
-import java.io.*;
-
-public class BufferToText {
- private static final int BSIZE = 1024;
- public static void main(String[] args) {
- try(
- FileChannel fc = new FileOutputStream(
- "data2.txt").getChannel()
- ) {
- fc.write(ByteBuffer.wrap("Some text".getBytes()));
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- ByteBuffer buff = ByteBuffer.allocate(BSIZE);
- try(
- FileChannel fc = new FileInputStream(
- "data2.txt").getChannel()
- ) {
- fc.read(buff);
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- buff.flip();
- // Doesn't work:
- System.out.println(buff.asCharBuffer());
- // Decode using this system's default Charset:
- buff.rewind();
- String encoding =
- System.getProperty("file.encoding");
- System.out.println("Decoded using " +
- encoding + ": "
- + Charset.forName(encoding).decode(buff));
- // Encode with something that prints:
- try(
- FileChannel fc = new FileOutputStream(
- "data2.txt").getChannel()
- ) {
- fc.write(ByteBuffer.wrap(
- "Some text".getBytes("UTF-16BE")));
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- // Now try reading again:
- buff.clear();
- try(
- FileChannel fc = new FileInputStream(
- "data2.txt").getChannel()
- ) {
- fc.read(buff);
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- buff.flip();
- System.out.println(buff.asCharBuffer());
- // Use a CharBuffer to write through:
- buff = ByteBuffer.allocate(24);
- buff.asCharBuffer().put("Some text");
- try(
- FileChannel fc = new FileOutputStream(
- "data2.txt").getChannel()
- ) {
- fc.write(buff);
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- // Read and display:
- buff.clear();
- try(
- FileChannel fc = new FileInputStream(
- "data2.txt").getChannel()
- ) {
- fc.read(buff);
- } catch(IOException e) {
- throw new RuntimeException(e);
- }
- buff.flip();
- System.out.println(buff.asCharBuffer());
- }
-}
-/* Output:
-????
-Decoded using windows-1252: Some text
-Some text
-Some textNULNULNUL
-*/
-```
-
-缓冲区包含普通字节,为了将这些字节转换为字符,我们必须在输入时对它们进行编码(这样它们输出时就有意义了),或者在输出时对它们进行解码。
-
-这可以使用 **java.nio.charset** 来完成。**Charset** 类,它提供工具来编码成许多不同类型的字符集:
-
-```java
-// newio/AvailableCharSets.java
-// (c)2017 MindView LLC: see Copyright.txt
-// We make no guarantees that this code is fit for any purpose.
-// Visit http://OnJava8.com for more book information.
-// Displays Charsets and aliases
-import java.nio.charset.*;
-import java.util.*;
-
-public class AvailableCharSets {
- public static void main(String[] args) {
- SortedMap
+
+# On Java 8
+
+- 《On Java 8》中文版,是事实上的《Java 编程思想》第5版。
+
+
+[](https://github.com/lingcoder/OnJava8) [](https://github.com/lingcoder/OnJava8)
+
+
+ 本页总访问次数:
+
+
+[GitHub](https://github.com/lingcoder/onJava8/)
+[Get Started](README.md)
+
+
+
+
+
+
+
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
new file mode 100644
index 0000000..fa448bd
--- /dev/null
+++ b/docs/_sidebar.md
@@ -0,0 +1,392 @@
+
+* [译者的话](README.md)
+* [封面](book/00-On-Java-8.md)
+* [前言](book/00-Preface.md)
+* [简介](book/00-Introduction.md)
+* [第一章 对象的概念](book/01-What-is-an-Object.md)
+ * [抽象](book/01-What-is-an-Object.md#抽象)
+ * [接口](book/01-What-is-an-Object.md#接口)
+ * [服务提供](book/01-What-is-an-Object.md#服务提供)
+ * [封装](book/01-What-is-an-Object.md#封装)
+ * [复用](book/01-What-is-an-Object.md#复用)
+ * [继承](book/01-What-is-an-Object.md#继承)
+ * [多态](book/01-What-is-an-Object.md#多态)
+ * [单继承](book/01-What-is-an-Object.md#单继承)
+ * [集合](book/01-What-is-an-Object.md#集合)
+ * [生命周期](book/01-What-is-an-Object.md#生命周期)
+ * [异常处理](book/01-What-is-an-Object.md#异常处理)
+ * [本章小结](book/01-What-is-an-Object.md#本章小结)
+* [第二章 安装Java和本书用例](book/02-Installing-Java-and-the-Book-Examples.md)
+ * [编辑器](book/02-Installing-Java-and-the-Book-Examples.md#编辑器)
+ * [Shell](book/02-Installing-Java-and-the-Book-Examples.md#Shell)
+ * [Java安装](book/02-Installing-Java-and-the-Book-Examples.md#Java安装)
+ * [校验安装](book/02-Installing-Java-and-the-Book-Examples.md#校验安装)
+ * [安装和运行代码示例](book/02-Installing-Java-and-the-Book-Examples.md#安装和运行代码示例)
+* [第三章 万物皆对象](book/03-Objects-Everywhere.md)
+ * [对象操纵](book/03-Objects-Everywhere.md#对象操纵)
+ * [对象创建](book/03-Objects-Everywhere.md#对象创建)
+ * [代码注释](book/03-Objects-Everywhere.md#代码注释)
+ * [对象清理](book/03-Objects-Everywhere.md#对象清理)
+ * [类的创建](book/03-Objects-Everywhere.md#类的创建)
+ * [程序编写](book/03-Objects-Everywhere.md#程序编写)
+ * [小试牛刀](book/03-Objects-Everywhere.md#小试牛刀)
+ * [编码风格](book/03-Objects-Everywhere.md#编码风格)
+ * [本章小结](book/03-Objects-Everywhere.md#本章小结)
+* [第四章 运算符](book/04-Operators.md)
+ * [使用说明](book/04-Operators.md#使用说明)
+ * [优先级](book/04-Operators.md#优先级)
+ * [赋值](book/04-Operators.md#赋值)
+ * [算术运算符](book/04-Operators.md#算术运算符)
+ * [递增和递减](book/04-Operators.md#递增和递减)
+ * [关系运算符](book/04-Operators.md#关系运算符)
+ * [逻辑运算符](book/04-Operators.md#逻辑运算符)
+ * [字面值常量](book/04-Operators.md#字面值常量)
+ * [按位运算符](book/04-Operators.md#按位运算符)
+ * [移位运算符](book/04-Operators.md#移位运算符)
+ * [三元运算符](book/04-Operators.md#三元运算符)
+ * [字符串运算符](book/04-Operators.md#字符串运算符)
+ * [常见陷阱](book/04-Operators.md#常见陷阱)
+ * [类型转换](book/04-Operators.md#类型转换)
+ * [Java没有sizeof](book/04-Operators.md#Java没有sizeof)
+ * [运算符总结](book/04-Operators.md#运算符总结)
+ * [本章小结](book/04-Operators.md#本章小结)
+* [第五章 控制流](book/05-Control-Flow.md)
+ * [true和flase](book/05-Control-Flow.md#true和flase)
+ * [if-else](book/05-Control-Flow.md#if-else)
+ * [迭代语句](book/05-Control-Flow.md#迭代语句)
+ * [for-in语法](book/05-Control-Flow.md#for-in语法)
+ * [return](book/05-Control-Flow.md#return)
+ * [break和continue](book/05-Control-Flow.md#break和continue)
+ * [臭名昭著的goto](book/05-Control-Flow.md#臭名昭著的goto)
+ * [switch](book/05-Control-Flow.md#switch)
+ * [switch字符串](book/05-Control-Flow.md#switch字符串)
+ * [本章小结](book/05-Control-Flow.md#本章小结)
+* [第六章 初始化和清理](book/06-Housekeeping.md)
+ * [利用构造器保证初始化](book/06-Housekeeping.md#利用构造器保证初始化)
+ * [方法重载](book/06-Housekeeping.md#方法重载)
+ * [无参构造器](book/06-Housekeeping.md#无参构造器)
+ * [this关键字](book/06-Housekeeping.md#this关键字)
+ * [垃圾回收器](book/06-Housekeeping.md#垃圾回收器)
+ * [成员初始化](book/06-Housekeeping.md#成员初始化)
+ * [构造器初始化](book/06-Housekeeping.md#构造器初始化)
+ * [数组初始化](book/06-Housekeeping.md#数组初始化)
+ * [枚举类型](book/06-Housekeeping.md#枚举类型)
+ * [本章小结](book/06-Housekeeping.md#本章小结)
+* [第七章 封装](book/07-Implementation-Hiding.md)
+ * [包的概念](book/07-Implementation-Hiding.md#包的概念)
+ * [访问权限修饰符](book/07-Implementation-Hiding.md#访问权限修饰符)
+ * [接口和实现](book/07-Implementation-Hiding.md#接口和实现)
+ * [类访问权限](book/07-Implementation-Hiding.md#类访问权限)
+ * [本章小结](book/07-Implementation-Hiding.md#本章小结)
+* [第八章 复用](book/08-Reuse.md)
+ * [组合语法](book/08-Reuse.md#组合语法)
+ * [继承语法](book/08-Reuse.md#继承语法)
+ * [委托](book/08-Reuse.md#委托)
+ * [结合组合与继承](book/08-Reuse.md#结合组合与继承)
+ * [组合与继承的选择](book/08-Reuse.md#组合与继承的选择)
+ * [protected](book/08-Reuse.md#protected)
+ * [向上转型](book/08-Reuse.md#向上转型)
+ * [final关键字](book/08-Reuse.md#final关键字)
+ * [类初始化和加载](book/08-Reuse.md#类初始化和加载)
+ * [本章小结](book/08-Reuse.md#本章小结)
+* [第九章 多态](book/09-Polymorphism.md)
+ * [向上转型回溯](book/09-Polymorphism.md#向上转型回溯)
+ * [深入理解](book/09-Polymorphism.md#深入理解)
+ * [构造器和多态](book/09-Polymorphism.md#构造器和多态)
+ * [返回类型协变](book/09-Polymorphism.md#返回类型协变)
+ * [使用继承设计](book/09-Polymorphism.md#使用继承设计)
+ * [本章小结](book/09-Polymorphism.md#本章小结)
+* [第十章 接口](book/10-Interfaces.md)
+ * [抽象类和方法](book/10-Interfaces.md#抽象类和方法)
+ * [接口创建](book/10-Interfaces.md#接口创建)
+ * [抽象类和接口](book/10-Interfaces.md#抽象类和接口)
+ * [完全解耦](book/10-Interfaces.md#完全解耦)
+ * [多接口结合](book/10-Interfaces.md#多接口结合)
+ * [使用继承扩展接口](book/10-Interfaces.md#使用继承扩展接口)
+ * [接口适配](book/10-Interfaces.md#接口适配)
+ * [接口字段](book/10-Interfaces.md#接口字段)
+ * [接口嵌套](book/10-Interfaces.md#接口嵌套)
+ * [接口和工厂方法模式](book/10-Interfaces.md#接口和工厂方法模式)
+ * [本章小结](book/10-Interfaces.md#本章小结)
+* [第十一章 内部类](book/11-Inner-Classes.md)
+ * [创建内部类](book/11-Inner-Classes.md#创建内部类)
+ * [链接外部类](book/11-Inner-Classes.md#链接外部类)
+ * [内部类this和new的使用](book/11-Inner-Classes.md#内部类this和new的使用)
+ * [内部类向上转型](book/11-Inner-Classes.md#内部类向上转型)
+ * [内部类方法和作用域](book/11-Inner-Classes.md#内部类方法和作用域)
+ * [匿名内部类](book/11-Inner-Classes.md#匿名内部类)
+ * [嵌套类](book/11-Inner-Classes.md#嵌套类)
+ * [内部类应用场景](book/11-Inner-Classes.md#内部类应用场景)
+ * [继承内部类](book/11-Inner-Classes.md#继承内部类)
+ * [重写内部类](book/11-Inner-Classes.md#重写内部类)
+ * [内部类局部变量](book/11-Inner-Classes.md#内部类局部变量)
+ * [内部类标识符](book/11-Inner-Classes.md#内部类标识符)
+ * [本章小结](book/11-Inner-Classes.md#本章小结)
+* [第十二章 集合](book/12-Collections.md)
+ * [泛型和类型安全的集合](book/12-Collections.md#泛型和类型安全的集合)
+ * [基本概念](book/12-Collections.md#基本概念)
+ * [添加元素组](book/12-Collections.md#添加元素组)
+ * [集合的打印](book/12-Collections.md#集合的打印)
+ * [列表List](book/12-Collections.md#列表List)
+ * [迭代器Iterators](book/12-Collections.md#迭代器Iterators)
+ * [链表LinkedList](book/12-Collections.md#链表LinkedList)
+ * [堆栈Stack](book/12-Collections.md#堆栈Stack)
+ * [集合Set](book/12-Collections.md#集合Set)
+ * [映射Map](book/12-Collections.md#映射Map)
+ * [队列Queue](book/12-Collections.md#队列Queue)
+ * [集合与迭代器](book/12-Collections.md#集合与迭代器)
+ * [for-in和迭代器](book/12-Collections.md#for-in和迭代器)
+ * [本章小结](book/12-Collections.md#本章小结)
+* [第十三章 函数式编程](book/13-Functional-Programming.md)
+ * [旧vs新](book/13-Functional-Programming.md#旧vs新)
+ * [Lambda表达式](book/13-Functional-Programming.md#Lambda表达式)
+ * [方法引用](book/13-Functional-Programming.md#方法引用)
+ * [函数式接口](book/13-Functional-Programming.md#函数式接口)
+ * [高阶函数](book/13-Functional-Programming.md#高阶函数)
+ * [闭包](book/13-Functional-Programming.md#闭包)
+ * [函数组合](book/13-Functional-Programming.md#函数组合)
+ * [Currying和Partial-Evaluation](book/13-Functional-Programming.md#Currying和Partial-Evaluation)
+ * [纯函数式编程](book/13-Functional-Programming.md#纯函数式编程)
+ * [本章小结](book/13-Functional-Programming.md#本章小结)
+* [第十四章 流式编程](book/14-Streams.md)
+ * [流支持](book/14-Streams.md#流支持)
+ * [流创建](book/14-Streams.md#流创建)
+ * [中级流操作](book/14-Streams.md#中级流操作)
+ * [Optional类](book/14-Streams.md#Optional类)
+ * [终端操作](book/14-Streams.md#终端操作)
+ * [本章小结](book/14-Streams.md#本章小结)
+* [第十五章 异常](book/15-Exceptions.md)
+ * [异常概念](book/15-Exceptions.md#异常概念)
+ * [基本异常](book/15-Exceptions.md#基本异常)
+ * [异常捕获](book/15-Exceptions.md#异常捕获)
+ * [自定义异常](book/15-Exceptions.md#自定义异常)
+ * [异常规范](book/15-Exceptions.md#异常规范)
+ * [任意异常捕获](book/15-Exceptions.md#任意异常捕获)
+ * [Java标准异常](book/15-Exceptions.md#Java标准异常)
+ * [finally关键字](book/15-Exceptions.md#finally关键字)
+ * [异常限制](book/15-Exceptions.md#异常限制)
+ * [异常构造](book/15-Exceptions.md#异常构造)
+ * [Try-With-Resources用法](book/15-Exceptions.md#Try-With-Resources用法)
+ * [异常匹配](book/15-Exceptions.md#异常匹配)
+ * [异常准则](book/15-Exceptions.md#异常准则)
+ * [异常指南](book/15-Exceptions.md#异常指南)
+ * [本章小结](book/15-Exceptions.md#本章小结)
+* [第十六章 代码校验](book/16-Validating-Your-Code.md)
+ * [测试](book/16-Validating-Your-Code.md#测试)
+ * [前提条件](book/16-Validating-Your-Code.md#前提条件)
+ * [测试驱动开发](book/16-Validating-Your-Code.md#测试驱动开发)
+ * [日志](book/16-Validating-Your-Code.md#日志)
+ * [调试](book/16-Validating-Your-Code.md#调试)
+ * [基准测试](book/16-Validating-Your-Code.md#基准测试)
+ * [分析和优化](book/16-Validating-Your-Code.md#分析和优化)
+ * [风格检测](book/16-Validating-Your-Code.md#风格检测)
+ * [静态错误分析](book/16-Validating-Your-Code.md#静态错误分析)
+ * [代码重审](book/16-Validating-Your-Code.md#代码重审)
+ * [结对编程](book/16-Validating-Your-Code.md#结对编程)
+ * [重构](book/16-Validating-Your-Code.md#重构)
+ * [持续集成](book/16-Validating-Your-Code.md#持续集成)
+ * [本章小结](book/16-Validating-Your-Code.md#本章小结)
+* [第十七章 文件](book/17-Files.md)
+ * [文件和目录路径](book/17-Files.md#文件和目录路径)
+ * [目录](book/17-Files.md#目录)
+ * [文件系统](book/17-Files.md#文件系统)
+ * [路径监听](book/17-Files.md#路径监听)
+ * [文件查找](book/17-Files.md#文件查找)
+ * [文件读写](book/17-Files.md#文件读写)
+ * [本章小结](book/17-Files.md#本章小结)
+* [第十八章 字符串](book/18-Strings.md)
+ * [字符串的不可变](book/18-Strings.md#字符串的不可变)
+ * [重载和StringBuilder](book/18-Strings.md#重载和StringBuilder)
+ * [意外递归](book/18-Strings.md#意外递归)
+ * [字符串操作](book/18-Strings.md#字符串操作)
+ * [格式化输出](book/18-Strings.md#格式化输出)
+ * [常规表达式](book/18-Strings.md#常规表达式)
+ * [扫描输入](book/18-Strings.md#扫描输入)
+ * [StringTokenizer类](book/18-Strings.md#StringTokenizer类)
+ * [本章小结](book/18-Strings.md#本章小结)
+* [第十九章 类型信息](book/19-Type-Information.md)
+ * [运行时类型信息](book/19-Type-Information.md#运行时类型信息)
+ * [类的对象](book/19-Type-Information.md#类的对象)
+ * [类型转换检测](book/19-Type-Information.md#类型转换检测)
+ * [注册工厂](book/19-Type-Information.md#注册工厂)
+ * [类的等价比较](book/19-Type-Information.md#类的等价比较)
+ * [反射运行时类信息](book/19-Type-Information.md#反射运行时类信息)
+ * [动态代理](book/19-Type-Information.md#动态代理)
+ * [Optional类](book/19-Type-Information.md#Optional类)
+ * [接口和类型](book/19-Type-Information.md#接口和类型)
+ * [本章小结](book/19-Type-Information.md#本章小结)
+* [第二十章 泛型](book/20-Generics.md)
+ * [简单泛型](book/20-Generics.md#简单泛型)
+ * [泛型接口](book/20-Generics.md#泛型接口)
+ * [泛型方法](book/20-Generics.md#泛型方法)
+ * [复杂模型构建](book/20-Generics.md#复杂模型构建)
+ * [泛型擦除](book/20-Generics.md#泛型擦除)
+ * [补偿擦除](book/20-Generics.md#补偿擦除)
+ * [边界](book/20-Generics.md#边界)
+ * [通配符](book/20-Generics.md#通配符)
+ * [问题](book/20-Generics.md#问题)
+ * [自我约束类型](book/20-Generics.md#自我约束类型)
+ * [动态类型安全](book/20-Generics.md#动态类型安全)
+ * [泛型异常](book/20-Generics.md#泛型异常)
+ * [混入](book/20-Generics.md#混入)
+ * [潜在类型](book/20-Generics.md#潜在类型)
+ * [补偿不足](book/20-Generics.md#补偿不足)
+ * [辅助潜在类型](book/20-Generics.md#辅助潜在类型)
+ * [泛型的优劣](book/20-Generics.md#泛型的优劣)
+* [第二十一章 数组](book/21-Arrays.md)
+ * [数组特性](book/21-Arrays.md#数组特性)
+ * [一等对象](book/21-Arrays.md#一等对象)
+ * [返回数组](book/21-Arrays.md#返回数组)
+ * [多维数组](book/21-Arrays.md#多维数组)
+ * [泛型数组](book/21-Arrays.md#泛型数组)
+ * [Arrays的fill方法](book/21-Arrays.md#Arrays的fill方法)
+ * [Arrays的setAll方法](book/21-Arrays.md#Arrays的setAll方法)
+ * [增量生成](book/21-Arrays.md#增量生成)
+ * [随机生成](book/21-Arrays.md#随机生成)
+ * [泛型和基本数组](book/21-Arrays.md#泛型和基本数组)
+ * [数组元素修改](book/21-Arrays.md#数组元素修改)
+ * [数组并行](book/21-Arrays.md#数组并行)
+ * [Arrays工具类](book/21-Arrays.md#Arrays工具类)
+ * [数组拷贝](book/21-Arrays.md#数组拷贝)
+ * [数组比较](book/21-Arrays.md#数组比较)
+ * [流和数组](book/21-Arrays.md#流和数组)
+ * [数组排序](book/21-Arrays.md#数组排序)
+ * [binarySearch二分查找](book/21-Arrays.md#binarySearch二分查找)
+ * [parallelPrefix并行前缀](book/21-Arrays.md#parallelPrefix并行前缀)
+ * [本章小结](book/21-Arrays.md#本章小结)
+* [第二十二章 枚举](book/22-Enumerations.md)
+ * [基本功能](book/22-Enumerations.md#基本功能)
+ * [方法添加](book/22-Enumerations.md#方法添加)
+ * [switch语句](book/22-Enumerations.md#switch语句)
+ * [values方法](book/22-Enumerations.md#values方法)
+ * [实现而非继承](book/22-Enumerations.md#实现而非继承)
+ * [随机选择](book/22-Enumerations.md#随机选择)
+ * [使用接口组织](book/22-Enumerations.md#使用接口组织)
+ * [使用EnumSet替代Flags](book/22-Enumerations.md#使用EnumSet替代Flags)
+ * [使用EnumMap](book/22-Enumerations.md#使用EnumMap)
+ * [常量特定方法](book/22-Enumerations.md#常量特定方法)
+ * [多次调度](book/22-Enumerations.md#多次调度)
+ * [本章小结](book/22-Enumerations.md#本章小结)
+* [第二十三章 注解](book/23-Annotations.md)
+ * [基本语法](book/23-Annotations.md#基本语法)
+ * [编写注解处理器](book/23-Annotations.md#编写注解处理器)
+ * [使用javac处理注解](book/23-Annotations.md#使用javac处理注解)
+ * [基于注解的单元测试](book/23-Annotations.md#基于注解的单元测试)
+ * [本章小结](book/23-Annotations.md#本章小结)
+* [第二十四章 并发编程](book/24-Concurrent-Programming.md)
+ * [术语问题](book/24-Concurrent-Programming.md#术语问题)
+ * [并发的超能力](book/24-Concurrent-Programming.md#并发的超能力)
+ * [针对速度](book/24-Concurrent-Programming.md#针对速度)
+ * [四句格言](book/24-Concurrent-Programming.md#四句格言)
+ * [残酷的真相](book/24-Concurrent-Programming.md#残酷的真相)
+ * [本章其余部分](book/24-Concurrent-Programming.md#本章其余部分)
+ * [并行流](book/24-Concurrent-Programming.md#并行流)
+ * [创建和运行任务](book/24-Concurrent-Programming.md#创建和运行任务)
+ * [终止耗时任务](book/24-Concurrent-Programming.md#终止耗时任务)
+ * [CompletableFuture类](book/24-Concurrent-Programming.md#CompletableFuture类)
+ * [死锁](book/24-Concurrent-Programming.md#死锁)
+ * [构造函数非线程安全](book/24-Concurrent-Programming.md#构造函数非线程安全)
+ * [复杂性和代价](book/24-Concurrent-Programming.md#复杂性和代价)
+ * [本章小结](book/24-Concurrent-Programming.md#本章小结)
+* [第二十五章 设计模式](book/25-Patterns.md)
+ * [概念](book/25-Patterns.md#概念)
+ * [构建型](book/25-Patterns.md#构建型)
+ * [面向实施](book/25-Patterns.md#面向实施)
+ * [工厂模式](book/25-Patterns.md#工厂模式)
+ * [函数对象](book/25-Patterns.md#函数对象)
+ * [接口改变](book/25-Patterns.md#接口改变)
+ * [解释器](book/25-Patterns.md#解释器)
+ * [回调](book/25-Patterns.md#回调)
+ * [多次调度](book/25-Patterns.md#多次调度)
+ * [模式重构](book/25-Patterns.md#模式重构)
+ * [抽象用法](book/25-Patterns.md#抽象用法)
+ * [多次派遣](book/25-Patterns.md#多次派遣)
+ * [访问者模式](book/25-Patterns.md#访问者模式)
+ * [RTTI的优劣](book/25-Patterns.md#RTTI的优劣)
+ * [本章小结](book/25-Patterns.md#本章小结)
+
+* [附录:补充](book/Appendix-Supplements.md)
+ * [可下载的补充](book/Appendix-Supplements.md#可下载的补充)
+ * [通过Thinking-in-C来巩固Java基础](book/Appendix-Supplements.md#通过Thinking-in-C来巩固Java基础)
+ * [动手实践](book/Appendix-Supplements.md#动手实践)
+* [附录:编程指南](book/Appendix-Programming-Guidelines.md)
+ * [设计](book/Appendix-Programming-Guidelines.md#设计)
+ * [实现](book/Appendix-Programming-Guidelines.md#实现)
+* [附录:文档注释](book/Appendix-Javadoc.md)
+* [附录:对象传递和返回](book/Appendix-Passing-and-Returning-Objects.md)
+ * [传递引用](book/Appendix-Passing-and-Returning-Objects.md#传递引用)
+ * [本地拷贝](book/Appendix-Passing-and-Returning-Objects.md#本地拷贝)
+ * [控制克隆](book/Appendix-Passing-and-Returning-Objects.md#控制克隆)
+ * [不可变类](book/Appendix-Passing-and-Returning-Objects.md#不可变类)
+ * [本章小结](book/Appendix-Passing-and-Returning-Objects.md#本章小结)
+* [附录:流式IO](book/Appendix-IO-Streams.md)
+ * [输入流类型](book/Appendix-IO-Streams.md#输入流类型)
+ * [输出流类型](book/Appendix-IO-Streams.md#输出流类型)
+ * [添加属性和有用的接口](book/Appendix-IO-Streams.md#添加属性和有用的接口)
+ * [Reader和Writer](book/Appendix-IO-Streams.md#Reader和Writer)
+ * [RandomAccessFile类](book/Appendix-IO-Streams.md#RandomAccessFile类)
+ * [IO流典型用途](book/Appendix-IO-Streams.md#IO流典型用途)
+ * [本章小结](book/Appendix-IO-Streams.md#本章小结)
+* [附录:标准IO](book/Appendix-Standard-IO.md)
+ * [执行控制](book/Appendix-Standard-IO.md#执行控制)
+* [附录:新IO](book/Appendix-New-IO.md)
+ * [ByteBuffer](book/Appendix-New-IO.md#ByteBuffer)
+ * [转换数据](book/Appendix-New-IO.md#数据转换)
+ * [获取原始类型](book/Appendix-New-IO.md#基本类型获取)
+ * [视图缓冲区](book/Appendix-New-IO.md#视图缓冲区)
+ * [使用缓冲区进行数据操作](book/Appendix-New-IO.md#缓冲区数据操作)
+ * [内存映射文件](book/Appendix-New-IO.md#内存映射文件)
+ * [文件锁定](book/Appendix-New-IO.md#文件锁定)
+* [附录:理解equals和hashCode方法](book/Appendix-Understanding-equals-and-hashCode.md)
+ * [equals典范](book/Appendix-Understanding-equals-and-hashCode.md#equals典范)
+ * [哈希和哈希码](book/Appendix-Understanding-equals-and-hashCode.md#哈希和哈希码)
+ * [调整HashMap](book/Appendix-Understanding-equals-and-hashCode.md#调整HashMap)
+* [附录:集合主题](book/Appendix-Collection-Topics.md)
+ * [示例数据](book/Appendix-Collection-Topics.md#示例数据)
+ * [List表现](book/Appendix-Collection-Topics.md#List表现)
+ * [Set表现](book/Appendix-Collection-Topics.md#Set表现)
+ * [在Map中使用函数式操作](book/Appendix-Collection-Topics.md#在Map中使用函数式操作)
+ * [选择Map的部分](book/Appendix-Collection-Topics.md#选择Map的部分)
+ * [集合的fill方法](book/Appendix-Collection-Topics.md#集合的fill方法)
+ * [使用Flyweight自定义集合和Map](book/Appendix-Collection-Topics.md#使用Flyweight自定义集合和Map)
+ * [集合功能](book/Appendix-Collection-Topics.md#集合功能)
+ * [可选操作](book/Appendix-Collection-Topics.md#可选操作)
+ * [Set和存储顺序](book/Appendix-Collection-Topics.md#Set和存储顺序)
+ * [队列](book/Appendix-Collection-Topics.md#队列)
+ * [理解Map](book/Appendix-Collection-Topics.md#理解Map)
+ * [集合工具类](book/Appendix-Collection-Topics.md#集合工具类)
+ * [持有引用](book/Appendix-Collection-Topics.md#持有引用)
+ * [避免旧式类库](book/Appendix-Collection-Topics.md#避免旧式类库)
+ * [本章小结](book/Appendix-Collection-Topics.md#本章小结)
+* [附录:并发底层原理](book/Appendix-Low-Level-Concurrency.md)
+ * [线程](book/Appendix-Low-Level-Concurrency.md#线程)
+ * [异常捕获](book/Appendix-Low-Level-Concurrency.md#异常捕获)
+ * [资源共享](book/Appendix-Low-Level-Concurrency.md#资源共享)
+ * [volatile关键字](book/Appendix-Low-Level-Concurrency.md#volatile关键字)
+ * [原子性](book/Appendix-Low-Level-Concurrency.md#原子性)
+ * [关键部分](book/Appendix-Low-Level-Concurrency.md#关键部分)
+ * [库组件](book/Appendix-Low-Level-Concurrency.md#库组件)
+ * [本章小结](book/Appendix-Low-Level-Concurrency.md#本章小结)
+* [附录:数据压缩](book/Appendix-Data-Compression.md)
+ * [使用Gzip简单压缩](book/Appendix-Data-Compression.md#使用Gzip简单压缩)
+ * [使用zip多文件存储](book/Appendix-Data-Compression.md#使用zip多文件存储)
+ * [Java的jar](book/Appendix-Data-Compression.md#Java的jar)
+* [附录:对象序列化](book/Appendix-Object-Serialization.md)
+ * [查找类](book/Appendix-Object-Serialization.md#查找类)
+ * [控制序列化](book/Appendix-Object-Serialization.md#控制序列化)
+ * [使用持久化](book/Appendix-Object-Serialization.md#使用持久化)
+* [附录:静态语言类型检查](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md)
+ * [前言](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#前言)
+ * [静态类型检查和测试](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#静态类型检查和测试)
+ * [如何提升打字](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#如何提升打字)
+ * [生产力的成本](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#生产力的成本)
+ * [静态和动态](book/Appendix-Benefits-and-Costs-of-Static-Type-Checking.md#静态和动态)
+* [附录:C++和Java的优良传统](book/Appendix-The-Positive-Legacy-of-C-plus-plus-and-Java.md)
+* [附录:成为一名程序员](book/Appendix-Becoming-a-Programmer.md)
+ * [如何开始](book/Appendix-Becoming-a-Programmer.md#如何开始)
+ * [码农生涯](book/Appendix-Becoming-a-Programmer.md#码农生涯)
+ * [百分之五的神话](book/Appendix-Becoming-a-Programmer.md#百分之五的神话)
+ * [重在动手](book/Appendix-Becoming-a-Programmer.md#重在动手)
+ * [像打字般编程](book/Appendix-Becoming-a-Programmer.md#像打字般编程)
+ * [做你喜欢的事](book/Appendix-Becoming-a-Programmer.md#做你喜欢的事)
+* [词汇表](book/GLOSSARY.md)
diff --git a/docs/_style/prism-master/.editorconfig b/docs/_style/prism-master/.editorconfig
new file mode 100644
index 0000000..b2e4603
--- /dev/null
+++ b/docs/_style/prism-master/.editorconfig
@@ -0,0 +1,14 @@
+root = true
+
+[*]
+insert_final_newline = false
+charset = utf-8
+indent_style = tab
+indent_size = 4
+
+[tests/languages/**.test]
+end_of_line = crlf
+
+[{package.json,.travis.yml}]
+indent_style = space
+indent_size = 2
\ No newline at end of file
diff --git a/docs/_style/prism-master/.gitattributes b/docs/_style/prism-master/.gitattributes
new file mode 100644
index 0000000..1d598bd
--- /dev/null
+++ b/docs/_style/prism-master/.gitattributes
@@ -0,0 +1,4 @@
+* text=auto
+
+# Test files should not have their line endings modified by git
+/tests/languages/**/*.test binary
\ No newline at end of file
diff --git a/docs/_style/prism-master/.gitignore b/docs/_style/prism-master/.gitignore
new file mode 100644
index 0000000..3b16b7d
--- /dev/null
+++ b/docs/_style/prism-master/.gitignore
@@ -0,0 +1,4 @@
+hide-*.js
+node_modules
+.idea/
+.DS_Store
diff --git a/docs/_style/prism-master/.npmignore b/docs/_style/prism-master/.npmignore
new file mode 100644
index 0000000..2ff075c
--- /dev/null
+++ b/docs/_style/prism-master/.npmignore
@@ -0,0 +1,27 @@
+.idea
+*.iml
+
+hide-*.js
+
+CNAME
+examples/
+img/
+templates/
+tests/
+vendor/
+*.tgz
+*.html
+style.css
+favicon.png
+logo.svg
+bower.json
+composer.json
+download.js
+examples.js
+gulpfile.js
+prefixfree.min.js
+utopia.js
+code.js
+.editorconfig
+.gitattributes
+.travis.yml
\ No newline at end of file
diff --git a/docs/_style/prism-master/.travis.yml b/docs/_style/prism-master/.travis.yml
new file mode 100644
index 0000000..3d0c7d1
--- /dev/null
+++ b/docs/_style/prism-master/.travis.yml
@@ -0,0 +1,23 @@
+language: node_js
+node_js:
+- '4'
+- '6'
+- '8'
+- '9'
+# Build all branches
+branches:
+ only:
+ - gh-pages
+ - /.*/
+before_script:
+- npm install -g gulp
+- gulp
+script: npm test
+deploy:
+ provider: npm
+ email: lea@verou.me
+ api_key:
+ secure: TjRcXEr7Y/9KRJ4EOEQbd2Ij8hxKj8c/yOpEROy2lTYv6QH9x46nFDgZEE3VHfp/nnBUYpC47dRaSxiUj8H5rtkMNCZrREZu1n1zahmzP6dI6kCj+H3GiY7yw/Jhdx3uvQZHwknW2TJ/YRsLeQsmMSG2HnJobY9Zn4REX5ccP2E=
+ on:
+ tags: true
+ repo: PrismJS/prism
diff --git a/docs/_style/prism-master/CHANGELOG.md b/docs/_style/prism-master/CHANGELOG.md
new file mode 100644
index 0000000..14c6405
--- /dev/null
+++ b/docs/_style/prism-master/CHANGELOG.md
@@ -0,0 +1,1334 @@
+# Prism Changelog
+
+## 1.15.0 (2018-06-16)
+
+### New components
+
+* __Template Tookit 2__ ([#1418](https://github.com/PrismJS/prism/issues/1418)) [[`e063992`](https://github.com/PrismJS/prism/commit/e063992)]
+* __XQuery__ ([#1411](https://github.com/PrismJS/prism/issues/1411)) [[`e326cb0`](https://github.com/PrismJS/prism/commit/e326cb0)]
+* __TAP__ ([#1430](https://github.com/PrismJS/prism/issues/1430)) [[`8c2b71f`](https://github.com/PrismJS/prism/commit/8c2b71f)]
+
+### Updated components
+
+* __HTTP__
+ * Absolute path is a valid request uri ([#1388](https://github.com/PrismJS/prism/issues/1388)) [[`f6e81cb`](https://github.com/PrismJS/prism/commit/f6e81cb)]
+* __Kotlin__
+ * Add keywords of Kotlin and modify it's number pattern. ([#1389](https://github.com/PrismJS/prism/issues/1389)) [[`1bf73b0`](https://github.com/PrismJS/prism/commit/1bf73b0)]
+ * Add `typealias` keyword ([#1437](https://github.com/PrismJS/prism/issues/1437)) [[`a21fdee`](https://github.com/PrismJS/prism/commit/a21fdee)]
+* __JavaScript
+ * Improve Regexp pattern [[`5b043cf`](https://github.com/PrismJS/prism/commit/5b043cf)]
+ * Add support for one level of nesting inside template strings. Fix [#1397](https://github.com/PrismJS/prism/issues/1397) [[`db2d0eb`](https://github.com/PrismJS/prism/commit/db2d0eb)]
+* __Elixir__
+ * Elixir: Fix attributes consuming punctuation. Fix [#1392](https://github.com/PrismJS/prism/issues/1392) [[`dac0485`](https://github.com/PrismJS/prism/commit/dac0485)]
+* __Bash__
+ * Change reserved keyword reference ([#1396](https://github.com/PrismJS/prism/issues/1396)) [[`b94f01f`](https://github.com/PrismJS/prism/commit/b94f01f)]
+* __PowerShell__
+ * Allow for one level of nesting in expressions inside strings. Fix [#1407](https://github.com/PrismJS/prism/issues/1407) [[`9272d6f`](https://github.com/PrismJS/prism/commit/9272d6f)]
+* __JSX__
+ * Allow for two levels of nesting inside JSX tags. Fix [#1408](https://github.com/PrismJS/prism/issues/1408) [[`f1cd7c5`](https://github.com/PrismJS/prism/commit/f1cd7c5)]
+ * Add support for fragments short syntax. Fix [#1421](https://github.com/PrismJS/prism/issues/1421) [[`38ce121`](https://github.com/PrismJS/prism/commit/38ce121)]
+* __Pascal__
+ * Add `objectpascal` as an alias to `pascal` ([#1426](https://github.com/PrismJS/prism/issues/1426)) [[`a0bfc84`](https://github.com/PrismJS/prism/commit/a0bfc84)]
+* __Swift__
+ * Fix Swift 'protocol' keyword ([#1440](https://github.com/PrismJS/prism/issues/1440)) [[`081e318`](https://github.com/PrismJS/prism/commit/081e318)]
+
+### Updated plugins
+
+* __File Highlight__
+ * Fix issue causing the Download button to show up on every code blocks. [[`cd22499`](https://github.com/PrismJS/prism/commit/cd22499)]
+ * Simplify lang regex on File Highlight plugin ([#1399](https://github.com/PrismJS/prism/issues/1399)) [[`7bc9a4a`](https://github.com/PrismJS/prism/commit/7bc9a4a)]
+* __Show Language__
+ * Don't process language if block language not set ([#1410](https://github.com/PrismJS/prism/issues/1410)) [[`c111869`](https://github.com/PrismJS/prism/commit/c111869)]
+* __Autoloader__
+ * ASP.NET should require C# [[`fa328bb`](https://github.com/PrismJS/prism/commit/fa328bb)]
+* __Line Numbers__
+ * Make line-numbers styles more specific ([#1434](https://github.com/PrismJS/prism/issues/1434), [#1435](https://github.com/PrismJS/prism/issues/1435)) [[`9ee4f54`](https://github.com/PrismJS/prism/commit/9ee4f54)]
+
+### Updated themes
+
+* Add .token.class-name to rest of themes ([#1360](https://github.com/PrismJS/prism/issues/1360)) [[`f356dfe`](https://github.com/PrismJS/prism/commit/f356dfe)]
+
+### Other changes
+
+* __Website__
+ * Site now loads over HTTPS!
+ * Use HTTPS / canonical URLs ([#1390](https://github.com/PrismJS/prism/issues/1390)) [[`95146c8`](https://github.com/PrismJS/prism/commit/95146c8)]
+ * Added Angular tutorial link [[`c436a7c`](https://github.com/PrismJS/prism/commit/c436a7c)]
+ * Use rel="icon" instead of rel="shortcut icon" ([#1398](https://github.com/PrismJS/prism/issues/1398)) [[`d95f8fb`](https://github.com/PrismJS/prism/commit/d95f8fb)]
+ * Fix Download page not handling multiple dependencies when from Redownload URL [[`c2ff248`](https://github.com/PrismJS/prism/commit/c2ff248)]
+ * Update documentation for node & webpack usage [[`1e99e96`](https://github.com/PrismJS/prism/commit/1e99e96)]
+* Handle optional dependencies in `loadLanguages()` ([#1417](https://github.com/PrismJS/prism/issues/1417)) [[`84935ac`](https://github.com/PrismJS/prism/commit/84935ac)]
+* Add Chinese translation [[`f2b1964`](https://github.com/PrismJS/prism/commit/f2b1964)]
+
+## 1.14.0 (2018-04-11)
+
+### New components
+* __GEDCOM__ ([#1385](https://github.com/PrismJS/prism/issues/1385)) [[`6e0b20a`](https://github.com/PrismJS/prism/commit/6e0b20a)]
+* __Lisp__ ([#1297](https://github.com/PrismJS/prism/issues/1297)) [[`46468f8`](https://github.com/PrismJS/prism/commit/46468f8)]
+* __Markup Templating__ ([#1367](https://github.com/PrismJS/prism/issues/1367)) [[`5f9c078`](https://github.com/PrismJS/prism/commit/5f9c078)]
+* __Soy__ ([#1387](https://github.com/PrismJS/prism/issues/1387)) [[`b4509bf`](https://github.com/PrismJS/prism/commit/b4509bf)]
+* __Velocity__ ([#1378](https://github.com/PrismJS/prism/issues/1378)) [[`5a524f7`](https://github.com/PrismJS/prism/commit/5a524f7)]
+* __Visual Basic__ ([#1382](https://github.com/PrismJS/prism/issues/1382)) [[`c673ec2`](https://github.com/PrismJS/prism/commit/c673ec2)]
+* __WebAssembly__ ([#1386](https://github.com/PrismJS/prism/issues/1386)) [[`c28d8c5`](https://github.com/PrismJS/prism/commit/c28d8c5)]
+
+### Updated components
+* __Bash__:
+ * Add curl to the list of common functions. Close [#1160](https://github.com/PrismJS/prism/issues/1160) [[`1bfc084`](https://github.com/PrismJS/prism/commit/1bfc084)]
+* __C-like__:
+ * Make single-line comments greedy. Fix [#1337](https://github.com/PrismJS/prism/issues/1337). Make sure [#1340](https://github.com/PrismJS/prism/issues/1340) stays fixed. [[`571f2c5`](https://github.com/PrismJS/prism/commit/571f2c5)]
+* __C#__:
+ * More generic class-name highlighting. Fix [#1365](https://github.com/PrismJS/prism/issues/1365) [[`a6837d2`](https://github.com/PrismJS/prism/commit/a6837d2)]
+ * More specific class-name highlighting. Fix [#1371](https://github.com/PrismJS/prism/issues/1371) [[`0a95f69`](https://github.com/PrismJS/prism/commit/0a95f69)]
+* __Eiffel__:
+ * Fix verbatim strings. Fix [#1379](https://github.com/PrismJS/prism/issues/1379) [[`04df41b`](https://github.com/PrismJS/prism/commit/04df41b)]
+* __Elixir__
+ * Make regexps greedy, remove comment hacks. Update known failures and tests. [[`e93d61f`](https://github.com/PrismJS/prism/commit/e93d61f)]
+* __ERB__:
+ * Make highlighting work properly in NodeJS ([#1367](https://github.com/PrismJS/prism/issues/1367)) [[`5f9c078`](https://github.com/PrismJS/prism/commit/5f9c078)]
+* __Fortran__:
+ * Make single-line comments greedy. Update known failures and tests. [[`c083b78`](https://github.com/PrismJS/prism/commit/c083b78)]
+* __Handlebars__:
+ * Make highlighting work properly in NodeJS ([#1367](https://github.com/PrismJS/prism/issues/1367)) [[`5f9c078`](https://github.com/PrismJS/prism/commit/5f9c078)]
+* __Java__:
+ * Add support for generics. Fix [#1351](https://github.com/PrismJS/prism/issues/1351) [[`a5cf302`](https://github.com/PrismJS/prism/commit/a5cf302)]
+* __JavaScript__:
+ * Add support for constants. Fix [#1348](https://github.com/PrismJS/prism/issues/1348) [[`9084481`](https://github.com/PrismJS/prism/commit/9084481)]
+ * Improve Regex matching [[`172d351`](https://github.com/PrismJS/prism/commit/172d351)]
+* __JSX__:
+ * Fix highlighting of empty objects. Fix [#1364](https://github.com/PrismJS/prism/issues/1364) [[`b26bbb8`](https://github.com/PrismJS/prism/commit/b26bbb8)]
+* __Monkey__:
+ * Make comments greedy. Update known failures and tests. [[`d7b2b43`](https://github.com/PrismJS/prism/commit/d7b2b43)]
+* __PHP__:
+ * Make highlighting work properly in NodeJS ([#1367](https://github.com/PrismJS/prism/issues/1367)) [[`5f9c078`](https://github.com/PrismJS/prism/commit/5f9c078)]
+* __Puppet__:
+ * Make heredoc, comments, regexps and strings greedy. Update known failures and tests. [[`0c139d1`](https://github.com/PrismJS/prism/commit/0c139d1)]
+* __Q__:
+ * Make comments greedy. Update known failures and tests. [[`a0f5081`](https://github.com/PrismJS/prism/commit/a0f5081)]
+* __Ruby__:
+ * Make multi-line comments greedy, remove single-line comment hack. Update known failures and tests. [[`b0e34fb`](https://github.com/PrismJS/prism/commit/b0e34fb)]
+* __SQL__:
+ * Add missing keywords. Fix [#1374](https://github.com/PrismJS/prism/issues/1374) [[`238b195`](https://github.com/PrismJS/prism/commit/238b195)]
+
+### Updated plugins
+* __Command Line__:
+ * Command Line: Allow specifying output prefix using data-filter-output attribute. ([#856](https://github.com/PrismJS/prism/issues/856)) [[`094d546`](https://github.com/PrismJS/prism/commit/094d546)]
+* __File Highlight__:
+ * Add option to provide a download button, when used with the Toolbar plugin. Fix [#1030](https://github.com/PrismJS/prism/issues/1030) [[`9f22952`](https://github.com/PrismJS/prism/commit/9f22952)]
+
+### Updated themes
+* __Default__:
+ * Reach AA contrast ratio level ([#1296](https://github.com/PrismJS/prism/issues/1296)) [[`8aea939`](https://github.com/PrismJS/prism/commit/8aea939)]
+
+### Other changes
+* Website: Remove broken third-party tutorials from homepage [[`0efd6e1`](https://github.com/PrismJS/prism/commit/0efd6e1)]
+* Docs: Mention `loadLanguages()` function on homepage in the nodeJS section. Close [#972](https://github.com/PrismJS/prism/issues/972), close [#593](https://github.com/PrismJS/prism/issues/593) [[`4a14d20`](https://github.com/PrismJS/prism/commit/4a14d20)]
+* Core: Greedy patterns should always be matched against the full string. Fix [#1355](https://github.com/PrismJS/prism/issues/1355) [[`294efaa`](https://github.com/PrismJS/prism/commit/294efaa)]
+* Crystal: Update known failures. [[`e1d2d42`](https://github.com/PrismJS/prism/commit/e1d2d42)]
+* D: Update known failures and tests. [[`13d9991`](https://github.com/PrismJS/prism/commit/13d9991)]
+* Markdown: Update known failures. [[`5b6c76d`](https://github.com/PrismJS/prism/commit/5b6c76d)]
+* Matlab: Update known failures. [[`259b6fc`](https://github.com/PrismJS/prism/commit/259b6fc)]
+* Website: Remove non-existent anchor to failures. Reword on homepage to make is less misleading. [[`8c0911a`](https://github.com/PrismJS/prism/commit/8c0911a)]
+* Website: Add link to Keep Markup plugin in FAQ [[`e8cb6d4`](https://github.com/PrismJS/prism/commit/e8cb6d4)]
+* Test suite: Memory leak in vm.runInNewContext() seems fixed. Revert [[`9a4b6fa`](https://github.com/PrismJS/prism/commit/9a4b6fa)] to drastically improve tests execution time. [[`9bceece`](https://github.com/PrismJS/prism/commit/9bceece), [`7c7602b`](https://github.com/PrismJS/prism/commit/7c7602b)]
+* Gulp: Don't minify `components/index.js` [[`689227b`](https://github.com/PrismJS/prism/commit/689227b)]
+* Website: Fix theme selection on Download page, when theme is in query string or hash. [[`b4d3063`](https://github.com/PrismJS/prism/commit/b4d3063)]
+* Update JSPM config to also include unminified components. Close [#995](https://github.com/PrismJS/prism/issues/995) [[`218f160`](https://github.com/PrismJS/prism/commit/218f160)]
+* Core: Fix support for language alias containing dash `-` [[`659ea31`](https://github.com/PrismJS/prism/commit/659ea31)]
+
+## 1.13.0 (2018-03-21)
+
+### New components
+* __ERB__ [[`e6213ac`](https://github.com/PrismJS/prism/commit/e6213ac)]
+* __PL/SQL__ ([#1338](https://github.com/PrismJS/prism/issues/1338)) [[`3599e6a`](https://github.com/PrismJS/prism/commit/3599e6a)]
+
+### Updated components
+* __JSX__:
+ * Add support for plain text inside tags ([#1357](https://github.com/PrismJS/prism/issues/1357)) [[`2b8321d`](https://github.com/PrismJS/prism/commit/2b8321d)]
+* __Markup__:
+ * Make tags greedy. Fix [#1356](https://github.com/PrismJS/prism/issues/1356) [[`af834be`](https://github.com/PrismJS/prism/commit/af834be)]
+* __Powershell__:
+ * Add lookbehind to fix function interpolation inside strings. Fix [#1361](https://github.com/PrismJS/prism/issues/1361) [[`d2c026e`](https://github.com/PrismJS/prism/commit/d2c026e)]
+* __Rust__:
+ * Improve char pattern so that lifetime annotations are matched better. Fix [#1353](https://github.com/PrismJS/prism/issues/1353) [[`efdccbf`](https://github.com/PrismJS/prism/commit/efdccbf)]
+
+### Updated themes
+* __Default__:
+ * Add color for class names [[`8572474`](https://github.com/PrismJS/prism/commit/8572474)]
+* __Coy__:
+ * Inherit pre's height on code, so it does not break on Download page. [[`c6c7fd1`](https://github.com/PrismJS/prism/commit/c6c7fd1)]
+
+### Other changes
+* Website: Auto-generate example headers [[`c3ed5b5`](https://github.com/PrismJS/prism/commit/c3ed5b5)]
+* Core: Allow cloning of circular structures. ([#1345](https://github.com/PrismJS/prism/issues/1345)) [[`f90d555`](https://github.com/PrismJS/prism/commit/f90d555)]
+* Core: Generate components.js from components.json and make it exportable to nodeJS. ([#1354](https://github.com/PrismJS/prism/issues/1354)) [[`ba60df0`](https://github.com/PrismJS/prism/commit/ba60df0)]
+* Website: Improve appearance of theme selector [[`0460cad`](https://github.com/PrismJS/prism/commit/0460cad)]
+* Website: Check stored theme by default + link both theme selectors together. Close [#1038](https://github.com/PrismJS/prism/issues/1038) [[`212dd4e`](https://github.com/PrismJS/prism/commit/212dd4e)]
+* Tests: Use the new components.js file directly [[`0e1a8b7`](https://github.com/PrismJS/prism/commit/0e1a8b7)]
+* Update .npmignore Close [#1274](https://github.com/PrismJS/prism/issues/1274) [[`a52319a`](https://github.com/PrismJS/prism/commit/a52319a)]
+* Add a loadLanguages() function for easy component loading on NodeJS ([#1359](https://github.com/PrismJS/prism/issues/1359)) [[`a5331a6`](https://github.com/PrismJS/prism/commit/a5331a6)]
+
+## 1.12.2 (2018-03-08)
+
+### Other changes
+* Test against NodeJS 4, 6, 8 and 9 ([#1329](https://github.com/PrismJS/prism/issues/1329)) [[`97b7d0a`](https://github.com/PrismJS/prism/commit/97b7d0a)]
+* Stop testing against NodeJS 0.10 and 0.12 [[`df01b1b`](https://github.com/PrismJS/prism/commit/df01b1b)]
+
+## 1.12.1 (2018-03-08)
+
+### Updated components
+* __C-like__:
+ * Revert [[`b98e5b9`](https://github.com/PrismJS/prism/commit/b98e5b9)] to fix [#1340](https://github.com/PrismJS/prism/issues/1340). Reopened [#1337](https://github.com/PrismJS/prism/issues/1337). [[`cebacdf`](https://github.com/PrismJS/prism/commit/cebacdf)]
+* __JSX__:
+ * Allow for one level of nested curly braces inside tag attribute value. Fix [#1335](https://github.com/PrismJS/prism/issues/1335) [[`05bf67d`](https://github.com/PrismJS/prism/commit/05bf67d)]
+* __Ruby__:
+ * Ensure module syntax is not confused with symbols. Fix [#1336](https://github.com/PrismJS/prism/issues/1336) [[`31a2a69`](https://github.com/PrismJS/prism/commit/31a2a69)]
+
+## 1.12.0 (2018-03-07)
+
+### New components
+* __ARFF__ ([#1327](https://github.com/PrismJS/prism/issues/1327)) [[`0bc98ac`](https://github.com/PrismJS/prism/commit/0bc98ac)]
+* __Clojure__ ([#1311](https://github.com/PrismJS/prism/issues/1311)) [[`8b4d3bd`](https://github.com/PrismJS/prism/commit/8b4d3bd)]
+* __Liquid__ ([#1326](https://github.com/PrismJS/prism/issues/1326)) [[`f0b2c9e`](https://github.com/PrismJS/prism/commit/f0b2c9e)]
+
+### Updated components
+* __Bash__:
+ * Add shell as an alias ([#1321](https://github.com/PrismJS/prism/issues/1321)) [[`67e16a2`](https://github.com/PrismJS/prism/commit/67e16a2)]
+ * Add support for quoted command substitution. Fix [#1287](https://github.com/PrismJS/prism/issues/1287) [[`63fc215`](https://github.com/PrismJS/prism/commit/63fc215)]
+* __C#__:
+ * Add "dotnet" alias. [[`405867c`](https://github.com/PrismJS/prism/commit/405867c)]
+* __C-like__:
+ * Change order of comment patterns and make multi-line one greedy. Fix [#1337](https://github.com/PrismJS/prism/issues/1337) [[`b98e5b9`](https://github.com/PrismJS/prism/commit/b98e5b9)]
+* __NSIS__:
+ * Add support for NSIS 3.03 ([#1288](https://github.com/PrismJS/prism/issues/1288)) [[`bd1e98b`](https://github.com/PrismJS/prism/commit/bd1e98b)]
+ * Add missing NSIS commands ([#1289](https://github.com/PrismJS/prism/issues/1289)) [[`ad2948f`](https://github.com/PrismJS/prism/commit/ad2948f)]
+* __PHP__:
+ * Add support for string interpolation inside double-quoted strings. Fix [#1146](https://github.com/PrismJS/prism/issues/1146) [[`9f1f8d6`](https://github.com/PrismJS/prism/commit/9f1f8d6)]
+ * Add support for Heredoc and Nowdoc strings [[`5d7223c`](https://github.com/PrismJS/prism/commit/5d7223c)]
+ * Fix shell-comment failure now that strings are greedy [[`ad25d22`](https://github.com/PrismJS/prism/commit/ad25d22)]
+* __PowerShell__:
+ * Add support for two levels of nested brackets inside namespace pattern. Fixes [#1317](https://github.com/PrismJS/prism/issues/1317) [[`3bc3e9c`](https://github.com/PrismJS/prism/commit/3bc3e9c)]
+* __Ruby__:
+ * Add keywords "protected", "private" and "public" [[`4593837`](https://github.com/PrismJS/prism/commit/4593837)]
+* __Rust__:
+ * Add support for lifetime-annotation and => operator. Fix [#1339](https://github.com/PrismJS/prism/issues/1339) [[`926f6f8`](https://github.com/PrismJS/prism/commit/926f6f8)]
+* __Scheme__:
+ * Don't highlight first number of a list as a function. Fix [#1331](https://github.com/PrismJS/prism/issues/1331) [[`51bff80`](https://github.com/PrismJS/prism/commit/51bff80)]
+* __SQL__:
+ * Add missing keywords and functions, fix numbers [[`de29d4a`](https://github.com/PrismJS/prism/commit/de29d4a)]
+
+### Updated plugins
+* __Autolinker__:
+ * Allow more chars in query string and hash to match more URLs. Fix [#1142](https://github.com/PrismJS/prism/issues/1142) [[`109bd6f`](https://github.com/PrismJS/prism/commit/109bd6f)]
+* __Copy to Clipboard__:
+ * Bump ClipboardJS to 2.0.0 and remove hack ([#1314](https://github.com/PrismJS/prism/issues/1314)) [[`e9f410e`](https://github.com/PrismJS/prism/commit/e9f410e)]
+* __Toolbar__:
+ * Prevent scrolling toolbar with content ([#1305](https://github.com/PrismJS/prism/issues/1305), [#1314](https://github.com/PrismJS/prism/issues/1314)) [[`84eeb89`](https://github.com/PrismJS/prism/commit/84eeb89)]
+* __Unescaped Markup__:
+ * Use msMatchesSelector for IE11 and below. Fix [#1302](https://github.com/PrismJS/prism/issues/1302) [[`c246c1a`](https://github.com/PrismJS/prism/commit/c246c1a)]
+* __WebPlatform Docs__:
+ * WebPlatform Docs plugin: Fix links. Fixes [#1290](https://github.com/PrismJS/prism/issues/1290) [[`7a9dbe0`](https://github.com/PrismJS/prism/commit/7a9dbe0)]
+
+### Other changes
+* Fix Autoloader's demo page [[`3dddac9`](https://github.com/PrismJS/prism/commit/3dddac9)]
+* Download page: Use hash instead of query-string for redownload URL. Fix [#1263](https://github.com/PrismJS/prism/issues/1263) [[`b03c02a`](https://github.com/PrismJS/prism/commit/b03c02a)]
+* Core: Don't thow an error if lookbehing is used without anything matching. [[`e0cd47f`](https://github.com/PrismJS/prism/commit/e0cd47f)]
+* Docs: Fix link to the `` element specification in HTML5 [[`a84263f`](https://github.com/PrismJS/prism/commit/a84263f)]
+* Docs: Mention support for `lang-xxxx` class. Close [#1312](https://github.com/PrismJS/prism/issues/1312) [[`a9e76db`](https://github.com/PrismJS/prism/commit/a9e76db)]
+* Docs: Add note on `async` parameter to clarify the requirement of using a single bundled file. Closes [#1249](https://github.com/PrismJS/prism/issues/1249) [[`eba0235`](https://github.com/PrismJS/prism/commit/eba0235)]
+
+## 1.11.0 (2018-02-05)
+
+### New components
+* __Content-Security-Policy (CSP)__ ([#1275](https://github.com/PrismJS/prism/issues/1275)) [[`b08cae5`](https://github.com/PrismJS/prism/commit/b08cae5)]
+* __HTTP Public-Key-Pins (HPKP)__ ([#1275](https://github.com/PrismJS/prism/issues/1275)) [[`b08cae5`](https://github.com/PrismJS/prism/commit/b08cae5)]
+* __HTTP String-Transport-Security (HSTS)__ ([#1275](https://github.com/PrismJS/prism/issues/1275)) [[`b08cae5`](https://github.com/PrismJS/prism/commit/b08cae5)]
+* __React TSX__ ([#1280](https://github.com/PrismJS/prism/issues/1280)) [[`fbe82b8`](https://github.com/PrismJS/prism/commit/fbe82b8)]
+
+### Updated components
+* __C++__:
+ * Add C++ platform-independent types ([#1271](https://github.com/PrismJS/prism/issues/1271)) [[`3da238f`](https://github.com/PrismJS/prism/commit/3da238f)]
+* __TypeScript__:
+ * Improve typescript with builtins ([#1277](https://github.com/PrismJS/prism/issues/1277)) [[`5de1b1f`](https://github.com/PrismJS/prism/commit/5de1b1f)]
+
+### Other changes
+* Fix passing of non-enumerable Error properties from the child test runner ([#1276](https://github.com/PrismJS/prism/issues/1276)) [[`38df653`](https://github.com/PrismJS/prism/commit/38df653)]
+
+## 1.10.0 (2018-01-17)
+
+### New components
+* __6502 Assembly__ ([#1245](https://github.com/PrismJS/prism/issues/1245)) [[`2ece18b`](https://github.com/PrismJS/prism/commit/2ece18b)]
+* __Elm__ ([#1174](https://github.com/PrismJS/prism/issues/1174)) [[`d6da70e`](https://github.com/PrismJS/prism/commit/d6da70e)]
+* __IchigoJam BASIC__ ([#1246](https://github.com/PrismJS/prism/issues/1246)) [[`cf840be`](https://github.com/PrismJS/prism/commit/cf840be)]
+* __Io__ ([#1251](https://github.com/PrismJS/prism/issues/1251)) [[`84ed3ed`](https://github.com/PrismJS/prism/commit/84ed3ed)]
+
+### Updated components
+* __BASIC__:
+ * Make strings greedy [[`60114d0`](https://github.com/PrismJS/prism/commit/60114d0)]
+* __C++__:
+ * Add C++11 raw string feature ([#1254](https://github.com/PrismJS/prism/issues/1254)) [[`71595be`](https://github.com/PrismJS/prism/commit/71595be)]
+
+### Updated plugins
+* __Autoloader__:
+ * Add support for `data-autoloader-path` ([#1242](https://github.com/PrismJS/prism/issues/1242)) [[`39360d6`](https://github.com/PrismJS/prism/commit/39360d6)]
+* __Previewers__:
+ * New plugin combining previous plugins Previewer: Base, Previewer: Angle, Previewer: Color, Previewer: Easing, Previewer: Gradient and Previewer: Time. ([#1244](https://github.com/PrismJS/prism/issues/1244)) [[`28e4b4c`](https://github.com/PrismJS/prism/commit/28e4b4c)]
+* __Unescaped Markup__:
+ * Make it work with any language ([#1265](https://github.com/PrismJS/prism/issues/1265)) [[`7bcdae7`](https://github.com/PrismJS/prism/commit/7bcdae7)]
+
+### Other changes
+* Add attribute `style` in `package.json` ([#1256](https://github.com/PrismJS/prism/issues/1256)) [[`a9b6785`](https://github.com/PrismJS/prism/commit/a9b6785)]
+
+## 1.9.0 (2017-12-06)
+
+### New components
+* __Flow__ [[`d27b70d`](https://github.com/PrismJS/prism/commit/d27b70d)]
+
+### Updated components
+* __CSS__:
+ * Unicode characters in CSS properties ([#1227](https://github.com/PrismJS/prism/issues/1227)) [[`f234ea4`](https://github.com/PrismJS/prism/commit/f234ea4)]
+* __JSX__:
+ * JSX: Improve highlighting support. Fix [#1235](https://github.com/PrismJS/prism/issues/1235) and [#1236](https://github.com/PrismJS/prism/issues/1236) [[`f41c5cd`](https://github.com/PrismJS/prism/commit/f41c5cd)]
+* __Markup__:
+ * Make CSS and JS inclusions in Markup greedy. Fix [#1240](https://github.com/PrismJS/prism/issues/1240) [[`7dc1e45`](https://github.com/PrismJS/prism/commit/7dc1e45)]
+* __PHP__:
+ * Add support for multi-line strings. Fix [#1233](https://github.com/PrismJS/prism/issues/1233) [[`9a542a0`](https://github.com/PrismJS/prism/commit/9a542a0)]
+
+### Updated plugins
+* __Copy to clipboard__:
+ * Fix test for native Clipboard. Fix [#1241](https://github.com/PrismJS/prism/issues/1241) [[`e7b5e82`](https://github.com/PrismJS/prism/commit/e7b5e82)]
+ * Copy to clipboard: Update to v1.7.1. Fix [#1220](https://github.com/PrismJS/prism/issues/1220) [[`a1b85e3`](https://github.com/PrismJS/prism/commit/a1b85e3), [`af50e44`](https://github.com/PrismJS/prism/commit/af50e44)]
+* __Line highlight__:
+ * Fixes to compatibility of line number and line higlight plugins ([#1194](https://github.com/PrismJS/prism/issues/1194)) [[`e63058f`](https://github.com/PrismJS/prism/commit/e63058f), [`3842a91`](https://github.com/PrismJS/prism/commit/3842a91)]
+* __Unescaped Markup__:
+ * Fix ambiguity in documentation by improving examples. Fix [#1197](https://github.com/PrismJS/prism/issues/1197) [[`924784a`](https://github.com/PrismJS/prism/commit/924784a)]
+
+### Other changes
+* Allow any element being root instead of document. ([#1230](https://github.com/PrismJS/prism/issues/1230)) [[`69f2e2c`](https://github.com/PrismJS/prism/commit/69f2e2c), [`6e50d44`](https://github.com/PrismJS/prism/commit/6e50d44)]
+* Coy Theme: The 'height' element makes code blocks the height of the browser canvas. ([#1224](https://github.com/PrismJS/prism/issues/1224)) [[`ac219d7`](https://github.com/PrismJS/prism/commit/ac219d7)]
+* Download page: Fix implicitly declared variable [[`f986551`](https://github.com/PrismJS/prism/commit/f986551)]
+* Download page: Add version number at the beginning of the generated files. Fix [#788](https://github.com/PrismJS/prism/issues/788) [[`928790d`](https://github.com/PrismJS/prism/commit/928790d)]
+
+## 1.8.4 (2017-11-05)
+
+### Updated components
+
+* __ABAP__:
+ * Regexp optimisation [[`7547f83`](https://github.com/PrismJS/prism/commit/7547f83)]
+* __ActionScript__:
+ * Fix XML regex + optimise [[`75d00d7`](https://github.com/PrismJS/prism/commit/75d00d7)]
+* __Ada__:
+ * Regexp simplification [[`e881fe3`](https://github.com/PrismJS/prism/commit/e881fe3)]
+* __Apacheconf__:
+ * Regexp optimisation [[`a065e61`](https://github.com/PrismJS/prism/commit/a065e61)]
+* __APL__:
+ * Regexp simplification [[`33297c4`](https://github.com/PrismJS/prism/commit/33297c4)]
+* __AppleScript__:
+ * Regexp optimisation [[`d879f36`](https://github.com/PrismJS/prism/commit/d879f36)]
+* __Arduino__:
+ * Don't use captures if not needed [[`16b338f`](https://github.com/PrismJS/prism/commit/16b338f)]
+* __ASP.NET__:
+ * Regexp optimisation [[`438926c`](https://github.com/PrismJS/prism/commit/438926c)]
+* __AutoHotkey__:
+ * Regexp simplification + don't use captures if not needed [[`5edfd2f`](https://github.com/PrismJS/prism/commit/5edfd2f)]
+* __Bash__:
+ * Regexp optimisation and simplification [[`75b9b29`](https://github.com/PrismJS/prism/commit/75b9b29)]
+* __Bro__:
+ * Regexp simplification + don't use captures if not needed [[`d4b9003`](https://github.com/PrismJS/prism/commit/d4b9003)]
+* __C__:
+ * Regexp optimisation + don't use captures if not needed [[`f61d487`](https://github.com/PrismJS/prism/commit/f61d487)]
+* __C++__:
+ * Fix operator regexp + regexp simplification + don't use captures if not needed [[`ffeb26e`](https://github.com/PrismJS/prism/commit/ffeb26e)]
+* __C#__:
+ * Remove duplicates in keywords + regexp optimisation + don't use captures if not needed [[`d28d178`](https://github.com/PrismJS/prism/commit/d28d178)]
+* __C-like__:
+ * Regexp simplification + don't use captures if not needed [[`918e0ff`](https://github.com/PrismJS/prism/commit/918e0ff)]
+* __CoffeeScript__:
+ * Regexp optimisation + don't use captures if not needed [[`5895978`](https://github.com/PrismJS/prism/commit/5895978)]
+* __Crystal__:
+ * Remove trailing comma [[`16979a3`](https://github.com/PrismJS/prism/commit/16979a3)]
+* __CSS__:
+ * Regexp simplification + don't use captures if not needed + handle multi-line style attributes [[`43d9f36`](https://github.com/PrismJS/prism/commit/43d9f36)]
+* __CSS Extras__:
+ * Regexp simplification [[`134ed70`](https://github.com/PrismJS/prism/commit/134ed70)]
+* __D__:
+ * Regexp optimisation [[`fbe39c9`](https://github.com/PrismJS/prism/commit/fbe39c9)]
+* __Dart__:
+ * Regexp optimisation [[`f24e919`](https://github.com/PrismJS/prism/commit/f24e919)]
+* __Django__:
+ * Regexp optimisation [[`a95c51d`](https://github.com/PrismJS/prism/commit/a95c51d)]
+* __Docker__:
+ * Regexp optimisation [[`27f99ff`](https://github.com/PrismJS/prism/commit/27f99ff)]
+* __Eiffel__:
+ * Regexp optimisation [[`b7cdea2`](https://github.com/PrismJS/prism/commit/b7cdea2)]
+* __Elixir__:
+ * Regexp optimisation + uniform behavior between ~r and ~s [[`5d12e80`](https://github.com/PrismJS/prism/commit/5d12e80)]
+* __Erlang__:
+ * Regexp optimisation [[`e7b411e`](https://github.com/PrismJS/prism/commit/e7b411e)]
+* __F#__:
+ * Regexp optimisation + don't use captures if not needed [[`7753fc4`](https://github.com/PrismJS/prism/commit/7753fc4)]
+* __Gherkin__:
+ * Regexp optimisation + don't use captures if not needed + added explanation comment on table-body regexp [[`f26197a`](https://github.com/PrismJS/prism/commit/f26197a)]
+* __Git__:
+ * Regexp optimisation [[`b9483b9`](https://github.com/PrismJS/prism/commit/b9483b9)]
+* __GLSL__:
+ * Regexp optimisation [[`e66d21b`](https://github.com/PrismJS/prism/commit/e66d21b)]
+* __Go__:
+ * Regexp optimisation + don't use captures if not needed [[`88caabb`](https://github.com/PrismJS/prism/commit/88caabb)]
+* __GraphQL__:
+ * Regexp optimisation and simplification [[`2474f06`](https://github.com/PrismJS/prism/commit/2474f06)]
+* __Groovy__:
+ * Regexp optimisation + don't use captures if not needed [[`e74e00c`](https://github.com/PrismJS/prism/commit/e74e00c)]
+* __Haml__:
+ * Regexp optimisation + don't use captures if not needed + fix typo in comment [[`23e3b43`](https://github.com/PrismJS/prism/commit/23e3b43)]
+* __Handlebars__:
+ * Regexp optimisation + don't use captures if not needed [[`09dbfce`](https://github.com/PrismJS/prism/commit/09dbfce)]
+* __Haskell__:
+ * Regexp simplification + don't use captures if not needed [[`f11390a`](https://github.com/PrismJS/prism/commit/f11390a)]
+* __HTTP__:
+ * Regexp simplification + don't use captures if not needed [[`37ef24e`](https://github.com/PrismJS/prism/commit/37ef24e)]
+* __Icon__:
+ * Regexp optimisation [[`9cf64a0`](https://github.com/PrismJS/prism/commit/9cf64a0)]
+* __J__:
+ * Regexp simplification [[`de15150`](https://github.com/PrismJS/prism/commit/de15150)]
+* __Java__:
+ * Don't use captures if not needed [[`96b35c8`](https://github.com/PrismJS/prism/commit/96b35c8)]
+* __JavaScript__:
+ * Regexp optimisation + don't use captures if not needed [[`93d4002`](https://github.com/PrismJS/prism/commit/93d4002)]
+* __Jolie__:
+ * Regexp optimisation + don't use captures if not needed + remove duplicates in keywords [[`a491f9e`](https://github.com/PrismJS/prism/commit/a491f9e)]
+* __JSON__:
+ * Make strings greedy, remove negative look-ahead for ":". Fix [#1204](https://github.com/PrismJS/prism/issues/1204) [[`98acd2d`](https://github.com/PrismJS/prism/commit/98acd2d)]
+ * Regexp optimisation + don't use captures if not needed [[`8fc1b03`](https://github.com/PrismJS/prism/commit/8fc1b03)]
+* __JSX__:
+ * Regexp optimisation + handle spread operator as a whole [[`28de4e2`](https://github.com/PrismJS/prism/commit/28de4e2)]
+* __Julia__:
+ * Regexp optimisation and simplification [[`12684c0`](https://github.com/PrismJS/prism/commit/12684c0)]
+* __Keyman__:
+ * Regexp optimisation + don't use captures if not needed [[`9726087`](https://github.com/PrismJS/prism/commit/9726087)]
+* __Kotlin__:
+ * Regexp simplification [[`12ff8dc`](https://github.com/PrismJS/prism/commit/12ff8dc)]
+* __LaTeX__:
+ * Regexp optimisation and simplification [[`aa426b0`](https://github.com/PrismJS/prism/commit/aa426b0)]
+* __LiveScript__:
+ * Make interpolated strings greedy + fix variable and identifier regexps [[`c581049`](https://github.com/PrismJS/prism/commit/c581049)]
+* __LOLCODE__:
+ * Don't use captures if not needed [[`52903af`](https://github.com/PrismJS/prism/commit/52903af)]
+* __Makefile__:
+ * Regexp optimisation [[`20ae2e5`](https://github.com/PrismJS/prism/commit/20ae2e5)]
+* __Markdown__:
+ * Don't use captures if not needed [[`f489a1e`](https://github.com/PrismJS/prism/commit/f489a1e)]
+* __Markup__:
+ * Regexp optimisation + fix punctuation inside attr-value [[`ea380c6`](https://github.com/PrismJS/prism/commit/ea380c6)]
+* __MATLAB__:
+ * Make strings greedy + handle line feeds better [[`4cd4f01`](https://github.com/PrismJS/prism/commit/4cd4f01)]
+* __Monkey__:
+ * Don't use captures if not needed [[`7f47140`](https://github.com/PrismJS/prism/commit/7f47140)]
+* __N4JS__:
+ * Don't use captures if not needed [[`2d3f9df`](https://github.com/PrismJS/prism/commit/2d3f9df)]
+* __NASM__:
+ * Regexp optimisation and simplification + don't use captures if not needed [[`9937428`](https://github.com/PrismJS/prism/commit/9937428)]
+* __nginx__:
+ * Remove trailing comma + remove duplicates in keywords [[`c6e7195`](https://github.com/PrismJS/prism/commit/c6e7195)]
+* __NSIS__:
+ * Regexp optimisation + don't use captures if not needed [[`beeb107`](https://github.com/PrismJS/prism/commit/beeb107)]
+* __Objective-C__:
+ * Don't use captures if not needed [[`9be0f88`](https://github.com/PrismJS/prism/commit/9be0f88)]
+* __OCaml__:
+ * Regexp simplification [[`5f5f38c`](https://github.com/PrismJS/prism/commit/5f5f38c)]
+* __OpenCL__:
+ * Don't use captures if not needed [[`5e70f1d`](https://github.com/PrismJS/prism/commit/5e70f1d)]
+* __Oz__:
+ * Fix atom regexp [[`9320e92`](https://github.com/PrismJS/prism/commit/9320e92)]
+* __PARI/GP__:
+ * Regexp optimisation [[`2c7b59b`](https://github.com/PrismJS/prism/commit/2c7b59b)]
+* __Parser__:
+ * Regexp simplification [[`569d511`](https://github.com/PrismJS/prism/commit/569d511)]
+* __Perl__:
+ * Regexp optimisation and simplification + don't use captures if not needed [[`0fe4cf6`](https://github.com/PrismJS/prism/commit/0fe4cf6)]
+* __PHP__:
+ * Don't use captures if not needed Golmote [[`5235f18`](https://github.com/PrismJS/prism/commit/5235f18)]
+* __PHP Extras__:
+ * Add word boundary after global keywords + don't use captures if not needed [[`9049a2a`](https://github.com/PrismJS/prism/commit/9049a2a)]
+* __PowerShell__:
+ * Regexp optimisation + don't use captures if not needed [[`0d05957`](https://github.com/PrismJS/prism/commit/0d05957)]
+* __Processing__:
+ * Regexp simplification [[`8110d38`](https://github.com/PrismJS/prism/commit/8110d38)]
+* __.properties__:
+ * Regexp optimisation [[`678b621`](https://github.com/PrismJS/prism/commit/678b621)]
+* __Protocol Buffers__:
+ * Don't use captures if not needed [[`3e256d8`](https://github.com/PrismJS/prism/commit/3e256d8)]
+* __Pug__:
+ * Don't use captures if not needed [[`76dc925`](https://github.com/PrismJS/prism/commit/76dc925)]
+* __Pure__:
+ * Make inline-lang greedy [[`92318b0`](https://github.com/PrismJS/prism/commit/92318b0)]
+* __Python__:
+ * Add Python builtin function highlighting ([#1205](https://github.com/PrismJS/prism/issues/1205)) [[`2169c99`](https://github.com/PrismJS/prism/commit/2169c99)]
+ * Python: Add highlighting to functions with space between name and parentheses ([#1207](https://github.com/PrismJS/prism/issues/1207)) [[`3badd8a`](https://github.com/PrismJS/prism/commit/3badd8a)]
+ * Make triple-quoted strings greedy + regexp optimisation and simplification [[`f09f9f5`](https://github.com/PrismJS/prism/commit/f09f9f5)]
+* __Qore__:
+ * Regexp simplification [[`69459f0`](https://github.com/PrismJS/prism/commit/69459f0)]
+* __R__:
+ * Regexp optimisation [[`06a9da4`](https://github.com/PrismJS/prism/commit/06a9da4)]
+* __Reason__:
+ * Regexp optimisation + don't use capture if not needed [[`19d79b4`](https://github.com/PrismJS/prism/commit/19d79b4)]
+* __Ren'py__:
+ * Make strings greedy + don't use captures if not needed [[`91d84d9`](https://github.com/PrismJS/prism/commit/91d84d9)]
+* __reST__:
+ * Regexp simplification + don't use captures if not needed [[`1a8b3e9`](https://github.com/PrismJS/prism/commit/1a8b3e9)]
+* __Rip__:
+ * Regexp optimisation [[`d7f0ee8`](https://github.com/PrismJS/prism/commit/d7f0ee8)]
+* __Ruby__:
+ * Regexp optimisation and simplification + don't use captures if not needed [[`4902ed4`](https://github.com/PrismJS/prism/commit/4902ed4)]
+* __Rust__:
+ * Regexp optimisation and simplification + don't use captures if not needed [[`cc9d874`](https://github.com/PrismJS/prism/commit/cc9d874)]
+* __Sass__:
+ * Regexp simplification Golmote [[`165d957`](https://github.com/PrismJS/prism/commit/165d957)]
+* __Scala__:
+ * Regexp optimisation Golmote [[`5f50c12`](https://github.com/PrismJS/prism/commit/5f50c12)]
+* __Scheme__:
+ * Regexp optimisation [[`bd19b04`](https://github.com/PrismJS/prism/commit/bd19b04)]
+* __SCSS__:
+ * Regexp simplification [[`c60b7d4`](https://github.com/PrismJS/prism/commit/c60b7d4)]
+* __Smalltalk__:
+ * Regexp simplification [[`41a2c76`](https://github.com/PrismJS/prism/commit/41a2c76)]
+* __Smarty__:
+ * Regexp optimisation and simplification [[`e169be9`](https://github.com/PrismJS/prism/commit/e169be9)]
+* __SQL__:
+ * Regexp optimisation [[`a6244a4`](https://github.com/PrismJS/prism/commit/a6244a4)]
+* __Stylus__:
+ * Regexp optimisation [[`df9506c`](https://github.com/PrismJS/prism/commit/df9506c)]
+* __Swift__:
+ * Don't use captures if not needed [[`a2d737a`](https://github.com/PrismJS/prism/commit/a2d737a)]
+* __Tcl__:
+ * Regexp simplification + don't use captures if not needed [[`f0b8a33`](https://github.com/PrismJS/prism/commit/f0b8a33)]
+* __Textile__:
+ * Regexp optimisation + don't use captures if not needed [[`08139ad`](https://github.com/PrismJS/prism/commit/08139ad)]
+* __Twig__:
+ * Regexp optimisation and simplification + don't use captures if not needed [[`0b10fd0`](https://github.com/PrismJS/prism/commit/0b10fd0)]
+* __TypeScript__:
+ * Don't use captures if not needed [[`e296caf`](https://github.com/PrismJS/prism/commit/e296caf)]
+* __Verilog__:
+ * Regexp simplification [[`1b24b34`](https://github.com/PrismJS/prism/commit/1b24b34)]
+* __VHDL__:
+ * Regexp optimisation and simplification [[`7af36df`](https://github.com/PrismJS/prism/commit/7af36df)]
+* __vim__:
+ * Remove duplicates in keywords [[`700505e`](https://github.com/PrismJS/prism/commit/700505e)]
+* __Wiki markup__:
+ * Fix escaping consistency [[`1fd690d`](https://github.com/PrismJS/prism/commit/1fd690d)]
+* __YAML__:
+ * Regexp optimisation + don't use captures if not needed [[`1fd690d`](https://github.com/PrismJS/prism/commit/1fd690d)]
+
+### Other changes
+* Remove comments spellcheck for AMP validation ([#1106](https://github.com/PrismJS/prism/issues/1106)) [[`de996d7`](https://github.com/PrismJS/prism/commit/de996d7)]
+* Prevent error from throwing when element does not have a parentNode in highlightElement. [[`c33be19`](https://github.com/PrismJS/prism/commit/c33be19)]
+* Provide a way to load Prism from inside a Worker without listening to messages. ([#1188](https://github.com/PrismJS/prism/issues/1188)) [[`d09982d`](https://github.com/PrismJS/prism/commit/d09982d)]
+
+## 1.8.3 (2017-10-19)
+
+### Other changes
+
+* Fix inclusion tests for Pug [[`955c2ab`](https://github.com/PrismJS/prism/commit/955c2ab)]
+
+## 1.8.2 (2017-10-19)
+
+### Updated components
+* __Jade__:
+ * Jade has been renamed to __Pug__ ([#1201](https://github.com/PrismJS/prism/issues/1201)) [[`bcfef7c`](https://github.com/PrismJS/prism/commit/bcfef7c)]
+* __JavaScript__:
+ * Better highlighting of functions ([#1190](https://github.com/PrismJS/prism/issues/1190)) [[`8ee2cd3`](https://github.com/PrismJS/prism/commit/8ee2cd3)]
+
+### Update plugins
+* __Copy to clipboard__:
+ * Fix error occurring when using in Chrome 61+ ([#1206](https://github.com/PrismJS/prism/issues/1206)) [[`b41d571`](https://github.com/PrismJS/prism/commit/b41d571)]
+* __Show invisibles__:
+ * Prevent error when using with Autoloader plugin ([#1195](https://github.com/PrismJS/prism/issues/1195)) [[`ed8bdb5`](https://github.com/PrismJS/prism/commit/ed8bdb5)]
+
+## 1.8.1 (2017-09-16)
+
+### Other changes
+
+* Add Arduino to components.js [[`290a3c6`](https://github.com/PrismJS/prism/commit/290a3c6)]
+
+## 1.8.0 (2017-09-16)
+
+### New components
+
+* __Arduino__ ([#1184](https://github.com/PrismJS/prism/issues/1184)) [[`edf2454`](https://github.com/PrismJS/prism/commit/edf2454)]
+* __OpenCL__ ([#1175](https://github.com/PrismJS/prism/issues/1175)) [[`131e8fa`](https://github.com/PrismJS/prism/commit/131e8fa)]
+
+### Updated plugins
+
+* __Autolinker__:
+ * Silently catch any error thrown by decodeURIComponent. Fixes [#1186](https://github.com/PrismJS/prism/issues/1186) [[`2e43fcf`](https://github.com/PrismJS/prism/commit/2e43fcf)]
+
+## 1.7.0 (2017-09-09)
+
+### New components
+
+* __Django/Jinja2__ ([#1085](https://github.com/PrismJS/prism/issues/1085)) [[`345b1b2`](https://github.com/PrismJS/prism/commit/345b1b2)]
+* __N4JS__ ([#1141](https://github.com/PrismJS/prism/issues/1141)) [[`eaa8ebb`](https://github.com/PrismJS/prism/commit/eaa8ebb)]
+* __Ren'py__ ([#658](https://github.com/PrismJS/prism/issues/658)) [[`7ab4013`](https://github.com/PrismJS/prism/commit/7ab4013)]
+* __VB.Net__ ([#1122](https://github.com/PrismJS/prism/issues/1122)) [[`5400651`](https://github.com/PrismJS/prism/commit/5400651)]
+
+### Updated components
+
+* __APL__:
+ * Add left shoe underbar and right shoe underbar ([#1072](https://github.com/PrismJS/prism/issues/1072)) [[`12238c5`](https://github.com/PrismJS/prism/commit/12238c5)]
+ * Update prism-apl.js ([#1126](https://github.com/PrismJS/prism/issues/1126)) [[`a5f3cdb`](https://github.com/PrismJS/prism/commit/a5f3cdb)]
+* __C__:
+ * Add more keywords and constants for C. ([#1029](https://github.com/PrismJS/prism/issues/1029)) [[`43a388e`](https://github.com/PrismJS/prism/commit/43a388e)]
+* __C#__:
+ * Fix wrong highlighting when three slashes appear inside string. Fix [#1091](https://github.com/PrismJS/prism/issues/1091) [[`dfb6f17`](https://github.com/PrismJS/prism/commit/dfb6f17)]
+* __C-like__:
+ * Add support for unclosed block comments. Close [#828](https://github.com/PrismJS/prism/issues/828) [[`3426ed1`](https://github.com/PrismJS/prism/commit/3426ed1)]
+* __Crystal__:
+ * Update Crystal keywords ([#1092](https://github.com/PrismJS/prism/issues/1092)) [[`125bff1`](https://github.com/PrismJS/prism/commit/125bff1)]
+* __CSS Extras__:
+ * Support CSS #RRGGBBAA ([#1139](https://github.com/PrismJS/prism/issues/1139)) [[`07a6806`](https://github.com/PrismJS/prism/commit/07a6806)]
+* __Docker__:
+ * Add dockerfile alias for docker language ([#1164](https://github.com/PrismJS/prism/issues/1164)) [[`601c47f`](https://github.com/PrismJS/prism/commit/601c47f)]
+ * Update the list of keywords for dockerfiles ([#1180](https://github.com/PrismJS/prism/issues/1180)) [[`f0d73e0`](https://github.com/PrismJS/prism/commit/f0d73e0)]
+* __Eiffel__:
+ * Add class-name highlighting for Eiffel ([#471](https://github.com/PrismJS/prism/issues/471)) [[`cd03587`](https://github.com/PrismJS/prism/commit/cd03587)]
+* __Handlebars__:
+ * Check for possible pre-existing marker strings in Handlebars [[`7a1a404`](https://github.com/PrismJS/prism/commit/7a1a404)]
+* __JavaScript__:
+ * Properly match every operator as a whole token. Fix [#1133](https://github.com/PrismJS/prism/issues/1133) [[`9f649fb`](https://github.com/PrismJS/prism/commit/9f649fb)]
+ * Allows uppercase prefixes in JS number literals ([#1151](https://github.com/PrismJS/prism/issues/1151)) [[`d4ee904`](https://github.com/PrismJS/prism/commit/d4ee904)]
+ * Reduced backtracking in regex pattern. Fix [#1159](https://github.com/PrismJS/prism/issues/1159) [[`ac09e97`](https://github.com/PrismJS/prism/commit/ac09e97)]
+* __JSON__:
+ * Fix property and string patterns performance. Fix [#1080](https://github.com/PrismJS/prism/issues/1080) [[`0ca1353`](https://github.com/PrismJS/prism/commit/0ca1353)]
+* __JSX__:
+ * JSX spread operator break. Fixes [#1061](https://github.com/PrismJS/prism/issues/1061) ([#1094](https://github.com/PrismJS/prism/issues/1094)) [[`561bceb`](https://github.com/PrismJS/prism/commit/561bceb)]
+ * Fix highlighting of attributes containing spaces [[`867ea42`](https://github.com/PrismJS/prism/commit/867ea42)]
+ * Improved performance for tags (when not matching) Fix [#1152](https://github.com/PrismJS/prism/issues/1152) [[`b0fe103`](https://github.com/PrismJS/prism/commit/b0fe103)]
+* __LOLCODE__:
+ * Make strings greedy Golmote [[`1a5e7a4`](https://github.com/PrismJS/prism/commit/1a5e7a4)]
+* __Markup__:
+ * Support HTML entities in attribute values ([#1143](https://github.com/PrismJS/prism/issues/1143)) [[`1d5047d`](https://github.com/PrismJS/prism/commit/1d5047d)]
+* __NSIS__:
+ * Update patterns ([#1033](https://github.com/PrismJS/prism/issues/1033)) [[`01a59d8`](https://github.com/PrismJS/prism/commit/01a59d8)]
+ * Add support for NSIS 3.02 ([#1169](https://github.com/PrismJS/prism/issues/1169)) [[`393b5f7`](https://github.com/PrismJS/prism/commit/393b5f7)]
+* __PHP__:
+ * Fix the PHP language ([#1100](https://github.com/PrismJS/prism/issues/1100)) [[`1453fa7`](https://github.com/PrismJS/prism/commit/1453fa7)]
+ * Check for possible pre-existing marker strings in PHP [[`36bc560`](https://github.com/PrismJS/prism/commit/36bc560)]
+* __Ruby__:
+ * Fix slash regex performance. Fix [#1083](https://github.com/PrismJS/prism/issues/1083) [[`a708730`](https://github.com/PrismJS/prism/commit/a708730)]
+ * Add support for =begin =end comments. Manual merge of [#1121](https://github.com/PrismJS/prism/issues/1121). [[`62cdaf8`](https://github.com/PrismJS/prism/commit/62cdaf8)]
+* __Smarty__:
+ * Check for possible pre-existing marker strings in Smarty [[`5df26e2`](https://github.com/PrismJS/prism/commit/5df26e2)]
+* __TypeScript__:
+ * Update typescript keywords ([#1064](https://github.com/PrismJS/prism/issues/1064)) [[`52020a0`](https://github.com/PrismJS/prism/commit/52020a0)]
+ * Chmod -x prism-typescript component ([#1145](https://github.com/PrismJS/prism/issues/1145)) [[`afe0542`](https://github.com/PrismJS/prism/commit/afe0542)]
+* __YAML__:
+ * Make strings greedy (partial fix for [#1075](https://github.com/PrismJS/prism/issues/1075)) [[`565a2cc`](https://github.com/PrismJS/prism/commit/565a2cc)]
+
+### Updated plugins
+
+* __Autolinker__:
+ * Fixed an rendering issue for encoded urls ([#1173](https://github.com/PrismJS/prism/issues/1173)) [[`abc007f`](https://github.com/PrismJS/prism/commit/abc007f)]
+* __Custom Class__:
+ * Add missing noCSS property for the Custom Class plugin [[`ba64f8d`](https://github.com/PrismJS/prism/commit/ba64f8d)]
+ * Added a default for classMap. Fixes [#1137](https://github.com/PrismJS/prism/issues/1137). ([#1157](https://github.com/PrismJS/prism/issues/1157)) [[`5400af9`](https://github.com/PrismJS/prism/commit/5400af9)]
+* __Keep Markup__:
+ * Store highlightedCode after reinserting markup. Fix [#1127](https://github.com/PrismJS/prism/issues/1127) [[`6df2ceb`](https://github.com/PrismJS/prism/commit/6df2ceb)]
+* __Line Highlight__:
+ * Cleanup left-over line-highlight tags before other plugins run [[`79b723d`](https://github.com/PrismJS/prism/commit/79b723d)]
+ * Avoid conflict between line-highlight and other plugins [[`224fdb8`](https://github.com/PrismJS/prism/commit/224fdb8)]
+* __Line Numbers__:
+ * Support soft wrap for line numbers plugin ([#584](https://github.com/PrismJS/prism/issues/584)) [[`849f1d6`](https://github.com/PrismJS/prism/commit/849f1d6)]
+ * Plugins fixes (unescaped-markup, line-numbers) ([#1012](https://github.com/PrismJS/prism/issues/1012)) [[`3fb7cf8`](https://github.com/PrismJS/prism/commit/3fb7cf8)]
+* __Normalize Whitespace__:
+ * Add Node.js support for the normalize-whitespace plugin [[`6c7dae2`](https://github.com/PrismJS/prism/commit/6c7dae2)]
+* __Unescaped Markup__:
+ * Plugins fixes (unescaped-markup, line-numbers) ([#1012](https://github.com/PrismJS/prism/issues/1012)) [[`3fb7cf8`](https://github.com/PrismJS/prism/commit/3fb7cf8)]
+
+### Updated themes
+* __Coy__:
+ * Scroll 'Coy' background with contents ([#1163](https://github.com/PrismJS/prism/issues/1163)) [[`310990b`](https://github.com/PrismJS/prism/commit/310990b)]
+
+### Other changes
+
+* Initial implementation of manual highlighting ([#1087](https://github.com/PrismJS/prism/issues/1087)) [[`bafc4cb`](https://github.com/PrismJS/prism/commit/bafc4cb)]
+* Remove dead link in Third-party tutorials section. Fixes [#1028](https://github.com/PrismJS/prism/issues/1028) [[`dffadc6`](https://github.com/PrismJS/prism/commit/dffadc6)]
+* Most languages now use the greedy flag for better highlighting [[`7549ecc`](https://github.com/PrismJS/prism/commit/7549ecc)]
+* .npmignore: Unignore components.js ([#1108](https://github.com/PrismJS/prism/issues/1108)) [[`1f699e7`](https://github.com/PrismJS/prism/commit/1f699e7)]
+* Run before-highlight and after-highlight hooks even when no grammar is found. Fix [#1134](https://github.com/PrismJS/prism/issues/1134) [[`70cb472`](https://github.com/PrismJS/prism/commit/70cb472)]
+* Replace [\w\W] with [\s\S] and [0-9] with \d in regexes ([#1107](https://github.com/PrismJS/prism/issues/1107)) [[`8aa2cc4`](https://github.com/PrismJS/prism/commit/8aa2cc4)]
+* Fix corner cases for the greedy flag ([#1095](https://github.com/PrismJS/prism/issues/1095)) [[`6530709`](https://github.com/PrismJS/prism/commit/6530709)]
+* Add Third Party Tutorial ([#1156](https://github.com/PrismJS/prism/issues/1156)) [[`c34e57b`](https://github.com/PrismJS/prism/commit/c34e57b)]
+* Add Composer support ([#648](https://github.com/PrismJS/prism/issues/648)) [[`2989633`](https://github.com/PrismJS/prism/commit/2989633)]
+* Remove IE8 plugin ([#992](https://github.com/PrismJS/prism/issues/992)) [[`25788eb`](https://github.com/PrismJS/prism/commit/25788eb)]
+* Website: remove width and height on logo.svg, so it becomes scalable. Close [#1005](https://github.com/PrismJS/prism/issues/1005) [[`0621ff7`](https://github.com/PrismJS/prism/commit/0621ff7)]
+* Remove yarn.lock ([#1098](https://github.com/PrismJS/prism/issues/1098)) [[`11eed25`](https://github.com/PrismJS/prism/commit/11eed25)]
+
+## 1.6.0 (2016-12-03)
+
+### New components
+
+* __.properties__ ([#980](https://github.com/PrismJS/prism/issues/980)) [[`be6219a`](https://github.com/PrismJS/prism/commit/be6219a)]
+* __Ada__ ([#949](https://github.com/PrismJS/prism/issues/949)) [[`65619f7`](https://github.com/PrismJS/prism/commit/65619f7)]
+* __GraphQL__ ([#971](https://github.com/PrismJS/prism/issues/971)) [[`e018087`](https://github.com/PrismJS/prism/commit/e018087)]
+* __Jolie__ ([#1014](https://github.com/PrismJS/prism/issues/1014)) [[`dfc1941`](https://github.com/PrismJS/prism/commit/dfc1941)]
+* __LiveScript__ ([#982](https://github.com/PrismJS/prism/issues/982)) [[`62e258c`](https://github.com/PrismJS/prism/commit/62e258c)]
+* __Reason__ (Fixes [#1046](https://github.com/PrismJS/prism/issues/1046)) [[`3cae6ce`](https://github.com/PrismJS/prism/commit/3cae6ce)]
+* __Xojo__ ([#994](https://github.com/PrismJS/prism/issues/994)) [[`0224b7c`](https://github.com/PrismJS/prism/commit/0224b7c)]
+
+### Updated components
+
+* __APL__:
+ * Add iota underbar ([#1024](https://github.com/PrismJS/prism/issues/1024)) [[`3c5c89a`](https://github.com/PrismJS/prism/commit/3c5c89a), [`ac21d33`](https://github.com/PrismJS/prism/commit/ac21d33)]
+* __AsciiDoc__:
+ * Optimized block regexps to prevent struggling on large files. Fixes [#1001](https://github.com/PrismJS/prism/issues/1001). [[`1a86d34`](https://github.com/PrismJS/prism/commit/1a86d34)]
+* __Bash__:
+ * Add `npm` to function list ([#969](https://github.com/PrismJS/prism/issues/969)) [[`912bdfe`](https://github.com/PrismJS/prism/commit/912bdfe)]
+* __CSS__:
+ * Make CSS strings greedy. Fix [#1013](https://github.com/PrismJS/prism/issues/1013). [[`e57e26d`](https://github.com/PrismJS/prism/commit/e57e26d)]
+* __CSS Extras__:
+ * Match attribute inside selectors [[`13fed76`](https://github.com/PrismJS/prism/commit/13fed76)]
+* _Groovy__:
+ * Fix order of decoding entities in groovy. Fixes [#1049](https://github.com/PrismJS/prism/issues/1049) ([#1050](https://github.com/PrismJS/prism/issues/1050)) [[`d75da8e`](https://github.com/PrismJS/prism/commit/d75da8e)]
+* __Ini__:
+ * Remove important token in ini definition ([#1047](https://github.com/PrismJS/prism/issues/1047)) [[`fe8ad8b`](https://github.com/PrismJS/prism/commit/fe8ad8b)]
+* __JavaScript__:
+ * Add exponentiation & spread/rest operator ([#991](https://github.com/PrismJS/prism/issues/991)) [[`b2de65a`](https://github.com/PrismJS/prism/commit/b2de65a), [`268d01e`](https://github.com/PrismJS/prism/commit/268d01e)]
+* __JSON_:
+ * JSON: Fixed issues with properties and strings + added tests. Fix [#1025](https://github.com/PrismJS/prism/issues/1025) [[`25a541d`](https://github.com/PrismJS/prism/commit/25a541d)]
+* __Markup__:
+ * Allow for dots in Markup tag names, but not in HTML tags included in Textile. Fixes [#888](https://github.com/PrismJS/prism/issues/888). [[`31ea66b`](https://github.com/PrismJS/prism/commit/31ea66b)]
+ * Make doctype case-insensitive ([#1009](https://github.com/PrismJS/prism/issues/1009)) [[`3dd7219`](https://github.com/PrismJS/prism/commit/3dd7219)]
+* __NSIS__:
+ * Updated patterns ([#1032](https://github.com/PrismJS/prism/issues/1032)) [[`76ba1b8`](https://github.com/PrismJS/prism/commit/76ba1b8)]
+* __PHP__:
+ * Make comments greedy. Fix [#197](https://github.com/PrismJS/prism/issues/197) [[`318aab3`](https://github.com/PrismJS/prism/commit/318aab3)]
+* __PowerShell__:
+ * Fix highlighting of empty comments ([#977](https://github.com/PrismJS/prism/issues/977)) [[`4fda477`](https://github.com/PrismJS/prism/commit/4fda477)]
+* __Puppet__:
+ * Fix over-greedy regexp detection ([#978](https://github.com/PrismJS/prism/issues/978)) [[`105be25`](https://github.com/PrismJS/prism/commit/105be25)]
+* __Ruby__:
+ * Fix typo `Fload` to `Float` in prism-ruby.js ([#1023](https://github.com/PrismJS/prism/issues/1023)) [[`22cb018`](https://github.com/PrismJS/prism/commit/22cb018)]
+ * Make strings greedy. Fixes [#1048](https://github.com/PrismJS/prism/issues/1048) [[`8b0520a`](https://github.com/PrismJS/prism/commit/8b0520a)]
+* __SCSS__:
+ * Alias statement as keyword. Fix [#246](https://github.com/PrismJS/prism/issues/246) [[`fd09391`](https://github.com/PrismJS/prism/commit/fd09391)]
+ * Highlight variables inside selectors and properties. [[`d6b5c2f`](https://github.com/PrismJS/prism/commit/d6b5c2f)]
+ * Highlight parent selector [[`8f5f1fa`](https://github.com/PrismJS/prism/commit/8f5f1fa)]
+* __TypeScript__:
+ * Add missing `from` keyword to typescript & set `ts` as alias. ([#1042](https://github.com/PrismJS/prism/issues/1042)) [[`cba78f3`](https://github.com/PrismJS/prism/commit/cba78f3)]
+
+### New plugins
+
+* __Copy to Clipboard__ ([#891](https://github.com/PrismJS/prism/issues/891)) [[`07b81ac`](https://github.com/PrismJS/prism/commit/07b81ac)]
+* __Custom Class__ ([#950](https://github.com/PrismJS/prism/issues/950)) [[`a0bd686`](https://github.com/PrismJS/prism/commit/a0bd686)]
+* __Data-URI Highlight__ ([#996](https://github.com/PrismJS/prism/issues/996)) [[`bdca61b`](https://github.com/PrismJS/prism/commit/bdca61b)]
+* __Toolbar__ ([#891](https://github.com/PrismJS/prism/issues/891)) [[`07b81ac`](https://github.com/PrismJS/prism/commit/07b81ac)]
+
+### Updated plugins
+
+* __Autoloader__:
+ * Updated documentation for Autoloader plugin [[`b4f3423`](https://github.com/PrismJS/prism/commit/b4f3423)]
+ * Download all grammars as a zip from Autoloader plugin page ([#981](https://github.com/PrismJS/prism/issues/981)) [[`0d0a007`](https://github.com/PrismJS/prism/commit/0d0a007), [`5c815d3`](https://github.com/PrismJS/prism/commit/5c815d3)]
+ * Removed duplicated script on Autoloader plugin page [[`9671996`](https://github.com/PrismJS/prism/commit/9671996)]
+ * Don't try to load "none" component. Fix [#1000](https://github.com/PrismJS/prism/issues/1000) [[`f89b0b9`](https://github.com/PrismJS/prism/commit/f89b0b9)]
+* __WPD__:
+ * Fix at-rule detection + don't process if language is not handled [[`2626728`](https://github.com/PrismJS/prism/commit/2626728)]
+
+### Other changes
+
+* Improvement to greedy-flag ([#967](https://github.com/PrismJS/prism/issues/967)) [[`500121b`](https://github.com/PrismJS/prism/commit/500121b), [`9893489`](https://github.com/PrismJS/prism/commit/9893489)]
+* Add setTimeout fallback for requestAnimationFrame. Fixes [#987](https://github.com/PrismJS/prism/issues/987). ([#988](https://github.com/PrismJS/prism/issues/988)) [[`c9bdcd3`](https://github.com/PrismJS/prism/commit/c9bdcd3)]
+* Added aria-hidden attributes on elements created by the Line Highlight and Line Numbers plugins. Fixes [#574](https://github.com/PrismJS/prism/issues/574). [[`e5587a7`](https://github.com/PrismJS/prism/commit/e5587a7)]
+* Don't insert space before ">" when there is no attributes [[`3dc8c9e`](https://github.com/PrismJS/prism/commit/3dc8c9e)]
+* Added missing hooks-related tests for AsciiDoc, Groovy, Handlebars, Markup, PHP and Smarty [[`c1a0c1b`](https://github.com/PrismJS/prism/commit/c1a0c1b)]
+* Fix issue when using Line numbers plugin and Normalise whitespace plugin together with Handlebars, PHP or Smarty. Fix [#1018](https://github.com/PrismJS/prism/issues/1018), [#997](https://github.com/PrismJS/prism/issues/997), [#935](https://github.com/PrismJS/prism/issues/935). Revert [#998](https://github.com/PrismJS/prism/issues/998). [[`86aa3d2`](https://github.com/PrismJS/prism/commit/86aa3d2)]
+* Optimized logo ([#990](https://github.com/PrismJS/prism/issues/990)) ([#1002](https://github.com/PrismJS/prism/issues/1002)) [[`f69e570`](https://github.com/PrismJS/prism/commit/f69e570), [`218fd25`](https://github.com/PrismJS/prism/commit/218fd25)]
+* Remove unneeded prefixed CSS ([#989](https://github.com/PrismJS/prism/issues/989)) [[`5e56833`](https://github.com/PrismJS/prism/commit/5e56833)]
+* Optimize images ([#1007](https://github.com/PrismJS/prism/issues/1007)) [[`b2fa6d5`](https://github.com/PrismJS/prism/commit/b2fa6d5)]
+* Add yarn.lock to .gitignore ([#1035](https://github.com/PrismJS/prism/issues/1035)) [[`03ecf74`](https://github.com/PrismJS/prism/commit/03ecf74)]
+* Fix greedy flag bug. Fixes [#1039](https://github.com/PrismJS/prism/issues/1039) [[`32cd99f`](https://github.com/PrismJS/prism/commit/32cd99f)]
+* Ruby: Fix test after [#1023](https://github.com/PrismJS/prism/issues/1023) [[`b15d43b`](https://github.com/PrismJS/prism/commit/b15d43b)]
+* Ini: Fix test after [#1047](https://github.com/PrismJS/prism/issues/1047) [[`25cdd3f`](https://github.com/PrismJS/prism/commit/25cdd3f)]
+* Reduce risk of XSS ([#1051](https://github.com/PrismJS/prism/issues/1051)) [[`17e33bc`](https://github.com/PrismJS/prism/commit/17e33bc)]
+* env.code can be modified by before-sanity-check hook even when using language-none. Fix [#1066](https://github.com/PrismJS/prism/issues/1066) [[`83bafbd`](https://github.com/PrismJS/prism/commit/83bafbd)]
+
+
+## 1.5.1 (2016-06-05)
+
+### Updated components
+
+* __Normalize Whitespace__:
+ * Add class that disables the normalize whitespace plugin [[`9385c54`](https://github.com/PrismJS/prism/commit/9385c54)]
+* __JavaScript Language__:
+ * Rearrange the `string` and `template-string` token in JavaScript [[`1158e46`](https://github.com/PrismJS/prism/commit/1158e46)]
+* __SQL Language__:
+ * add delimeter and delimeters keywords to sql ([#958](https://github.com/PrismJS/prism/pull/958)) [[`a9ef24e`](https://github.com/PrismJS/prism/commit/a9ef24e)]
+ * add AUTO_INCREMENT and DATE keywords to sql ([#954](https://github.com/PrismJS/prism/pull/954)) [[`caea2af`](https://github.com/PrismJS/prism/commit/caea2af)]
+* __Diff Language__:
+ * Highlight diff lines with only + or - ([#952](https://github.com/PrismJS/prism/pull/952)) [[`4d0526f`](https://github.com/PrismJS/prism/commit/4d0526f)]
+
+### Other changes
+
+* Allow for asynchronous loading of prism.js ([#959](https://github.com/PrismJS/prism/pull/959))
+* Use toLowerCase on language names ([#957](https://github.com/PrismJS/prism/pull/957)) [[`acd9508`](https://github.com/PrismJS/prism/commit/acd9508)]
+* link to index for basic usage - fixes [#945](https://github.com/PrismJS/prism/issues/945) ([#946](https://github.com/PrismJS/prism/pull/946)) [[`6c772d8`](https://github.com/PrismJS/prism/commit/6c772d8)]
+* Fixed monospace typo ([#953](https://github.com/PrismJS/prism/pull/953)) [[`e6c3498`](https://github.com/PrismJS/prism/commit/e6c3498)]
+
+## 1.5.0 (2016-05-01)
+
+### New components
+
+* __Bro Language__ ([#925](https://github.com/PrismJS/prism/pull/925))
+* __Protocol Buffers Language__ ([#938](https://github.com/PrismJS/prism/pull/938)) [[`ae4a4f2`](https://github.com/PrismJS/prism/commit/ae4a4f2)]
+
+### Updated components
+
+* __Keep Markup__:
+ * Fix Keep Markup plugin incorrect highlighting ([#880](https://github.com/PrismJS/prism/pull/880)) [[`24841ef`](https://github.com/PrismJS/prism/commit/24841ef)]
+* __Groovy Language__:
+ * Fix double HTML-encoding bug in Groovy language [[`24a0936`](https://github.com/PrismJS/prism/commit/24a0936)]
+* __Java Language__:
+ * Adding annotation token for Java ([#905](https://github.com/PrismJS/prism/pull/905)) [[`367ace6`](https://github.com/PrismJS/prism/commit/367ace6)]
+* __SAS Language__:
+ * Add missing keywords for SAS ([#922](https://github.com/PrismJS/prism/pull/922))
+* __YAML Language__:
+ * fix hilighting of YAML keys on first line of code block ([#943](https://github.com/PrismJS/prism/pull/943)) [[`f19db81`](https://github.com/PrismJS/prism/commit/f19db81)]
+* __C# Language__:
+ * Support for generic methods in csharp [[`6f75735`](https://github.com/PrismJS/prism/commit/6f75735)]
+
+### New plugins
+
+* __Unescaped Markup__ [[`07d77e5`](https://github.com/PrismJS/prism/commit/07d77e5)]
+* __Normalize Whitespace__ ([#847](https://github.com/PrismJS/prism/pull/847)) [[`e86ec01`](https://github.com/PrismJS/prism/commit/e86ec01)]
+
+### Other changes
+
+* Add JSPM support [[`ad048ab`](https://github.com/PrismJS/prism/commit/ad048ab)]
+* update linear-gradient syntax from `left` to `to right` [[`cd234dc`](https://github.com/PrismJS/prism/commit/cd234dc)]
+* Add after-property to allow ordering of plugins [[`224b7a1`](https://github.com/PrismJS/prism/commit/224b7a1)]
+* Partial solution for the "Comment-like substrings"-problem [[`2705c50`](https://github.com/PrismJS/prism/commit/2705c50)]
+* Add property 'aliasTitles' to components.js [[`54400fb`](https://github.com/PrismJS/prism/commit/54400fb)]
+* Add before-highlightall hook [[`70a8602`](https://github.com/PrismJS/prism/commit/70a8602)]
+* Fix catastrophic backtracking regex issues in JavaScript [[`ab65be2`](https://github.com/PrismJS/prism/commit/ab65be2)]
+
+## 1.4.1 (2016-02-03)
+
+### Other changes
+
+* Fix DFS bug in Prism core [[`b86c727`](https://github.com/PrismJS/prism/commit/b86c727)]
+
+## 1.4.0 (2016-02-03)
+
+### New components
+
+* __Solarized Light__ ([#855](https://github.com/PrismJS/prism/pull/855)) [[`70846ba`](https://github.com/PrismJS/prism/commit/70846ba)]
+* __JSON__ ([#370](https://github.com/PrismJS/prism/pull/370)) [[`ad2fcd0`](https://github.com/PrismJS/prism/commit/ad2fcd0)]
+
+### Updated components
+
+* __Show Language__:
+ * Remove data-language attribute ([#840](https://github.com/PrismJS/prism/pull/840)) [[`eb9a83c`](https://github.com/PrismJS/prism/commit/eb9a83c)]
+ * Allow custom label without a language mapping ([#837](https://github.com/PrismJS/prism/pull/837)) [[`7e74aef`](https://github.com/PrismJS/prism/commit/7e74aef)]
+* __JSX__:
+ * Better Nesting in JSX attributes ([#842](https://github.com/PrismJS/prism/pull/842)) [[`971dda7`](https://github.com/PrismJS/prism/commit/971dda7)]
+* __File Highlight__:
+ * Defer File Highlight until the full DOM has loaded. ([#844](https://github.com/PrismJS/prism/pull/844)) [[`6f995ef`](https://github.com/PrismJS/prism/commit/6f995ef)]
+* __Coy Theme__:
+ * Fix coy theme shadows ([#865](https://github.com/PrismJS/prism/pull/865)) [[`58d2337`](https://github.com/PrismJS/prism/commit/58d2337)]
+* __Show Invisibles__:
+ * Ensure show-invisibles compat with autoloader ([#874](https://github.com/PrismJS/prism/pull/874)) [[`c3cfb1f`](https://github.com/PrismJS/prism/commit/c3cfb1f)]
+ * Add support for the space character for the show-invisibles plugin ([#876](https://github.com/PrismJS/prism/pull/876)) [[`05442d3`](https://github.com/PrismJS/prism/commit/05442d3)]
+
+### New plugins
+
+* __Command Line__ ([#831](https://github.com/PrismJS/prism/pull/831)) [[`8378906`](https://github.com/PrismJS/prism/commit/8378906)]
+
+### Other changes
+
+* Use document.currentScript instead of document.getElementsByTagName() [[`fa98743`](https://github.com/PrismJS/prism/commit/fa98743)]
+* Add prefix for Firefox selection and move prefixed rule first [[`6d54717`](https://github.com/PrismJS/prism/commit/6d54717)]
+* No background for `` in `` [[`8c310bc`](https://github.com/PrismJS/prism/commit/8c310bc)]
+* Fixing to initial copyright year [[`69cbf7a`](https://github.com/PrismJS/prism/commit/69cbf7a)]
+* Simplify the “lang” regex [[`417f54a`](https://github.com/PrismJS/prism/commit/417f54a)]
+* Fix broken heading links [[`a7f9e62`](https://github.com/PrismJS/prism/commit/a7f9e62)]
+* Prevent infinite recursion in DFS [[`02894e1`](https://github.com/PrismJS/prism/commit/02894e1)]
+* Fix incorrect page title [[`544b56f`](https://github.com/PrismJS/prism/commit/544b56f)]
+* Link scss to webplatform wiki [[`08d979a`](https://github.com/PrismJS/prism/commit/08d979a)]
+* Revert white-space to normal when code is inline instead of in a pre [[`1a971b5`](https://github.com/PrismJS/prism/commit/1a971b5)]
+
+## 1.3.0 (2015-10-26)
+
+### New components
+
+* __AsciiDoc__ ([#800](https://github.com/PrismJS/prism/issues/800)) [[`6803ca0`](https://github.com/PrismJS/prism/commit/6803ca0)]
+* __Haxe__ ([#811](https://github.com/PrismJS/prism/issues/811)) [[`bd44341`](https://github.com/PrismJS/prism/commit/bd44341)]
+* __Icon__ ([#803](https://github.com/PrismJS/prism/issues/803)) [[`b43c5f3`](https://github.com/PrismJS/prism/commit/b43c5f3)]
+* __Kotlin ([#814](https://github.com/PrismJS/prism/issues/814)) [[`e8a31a5`](https://github.com/PrismJS/prism/commit/e8a31a5)]
+* __Lua__ ([#804](https://github.com/PrismJS/prism/issues/804)) [[`a36bc4a`](https://github.com/PrismJS/prism/commit/a36bc4a)]
+* __Nix__ ([#795](https://github.com/PrismJS/prism/issues/795)) [[`9b275c8`](https://github.com/PrismJS/prism/commit/9b275c8)]
+* __Oz__ ([#805](https://github.com/PrismJS/prism/issues/805)) [[`388c53f`](https://github.com/PrismJS/prism/commit/388c53f)]
+* __PARI/GP__ ([#802](https://github.com/PrismJS/prism/issues/802)) [[`253c035`](https://github.com/PrismJS/prism/commit/253c035)]
+* __Parser__ ([#808](https://github.com/PrismJS/prism/issues/808)) [[`a953b3a`](https://github.com/PrismJS/prism/commit/a953b3a)]
+* __Puppet__ ([#813](https://github.com/PrismJS/prism/issues/813)) [[`81933ee`](https://github.com/PrismJS/prism/commit/81933ee)]
+* __Roboconf__ ([#812](https://github.com/PrismJS/prism/issues/812)) [[`f5db346`](https://github.com/PrismJS/prism/commit/f5db346)]
+
+### Updated components
+
+* __C__:
+ * Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
+* __C#__:
+ * Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
+ * Fix detection of float numbers ([#806](https://github.com/PrismJS/prism/issues/806)) [[`1dae72b`](https://github.com/PrismJS/prism/commit/1dae72b)]
+* __F#__:
+ * Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
+* __JavaScript__:
+ * Highlight true and false as booleans ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
+* __Python__:
+ * Highlight triple-quoted strings before comments. Fix [#815](https://github.com/PrismJS/prism/issues/815) [[`90fbf0b`](https://github.com/PrismJS/prism/commit/90fbf0b)]
+
+### New plugins
+
+* __Previewer: Time__ ([#790](https://github.com/PrismJS/prism/issues/790)) [[`88173de`](https://github.com/PrismJS/prism/commit/88173de)]
+* __Previewer: Angle__ ([#791](https://github.com/PrismJS/prism/issues/791)) [[`a434c86`](https://github.com/PrismJS/prism/commit/a434c86)]
+
+### Other changes
+
+* Increase mocha's timeout [[`f1c41db`](https://github.com/PrismJS/prism/commit/f1c41db)]
+* Prevent most errors in IE8. Fix [#9](https://github.com/PrismJS/prism/issues/9) [[`9652d75`](https://github.com/PrismJS/prism/commit/9652d75)]
+* Add U.S. Web Design Standards on homepage. Fix [#785](https://github.com/PrismJS/prism/issues/785) [[`e10d48b`](https://github.com/PrismJS/prism/commit/e10d48b), [`79ebbf8`](https://github.com/PrismJS/prism/commit/79ebbf8), [`2f7088d`](https://github.com/PrismJS/prism/commit/2f7088d)]
+* Added gulp task to autolink PRs and commits in changelog [[`5ec4e4d`](https://github.com/PrismJS/prism/commit/5ec4e4d)]
+* Use child processes to run each set of tests, in order to deal with the memory leak in vm.runInNewContext() [[`9a4b6fa`](https://github.com/PrismJS/prism/commit/9a4b6fa)]
+
+## 1.2.0 (2015-10-07)
+
+### New components
+
+* __Batch__ ([#781](https://github.com/PrismJS/prism/issues/781)) [[`eab5b06`](https://github.com/PrismJS/prism/commit/eab5b06)]
+
+### Updated components
+
+* __ASP.NET__:
+ * Simplified pattern for `
+
+
+
+
+
+
+
+
+
+ Customize your download
+ Select your compression level, as well as the languages and plugins you need.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+