Skip to content

rebuild sidebar.md and SUMMARY.md #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
860 changes: 447 additions & 413 deletions SUMMARY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/book/05-Control-Flow.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ i = 4 j = 8

上例中 **int** 类型声明包含了 `i` 和 `j`。实际上,在初始化部分我们可以定义任意数量的同类型变量。**注意**:在 Java 中,仅允许 **for** 循环在控制表达式中定义变量。 我们不能将此方法与其他的循环语句和选择语句中一起使用。同时,我们可以看到:无论在初始化还是在步进部分,语句都是顺序执行的。

## for-in 语法
## for-in 语法

Java 5 引入了更为简洁的“增强版 **for** 循环”语法来操纵数组和集合。(更多细节,可参考 [数组](./21-Arrays.md) 和 [集合](./12-Collections.md) 章节内容)。大部分文档也称其为 **for-each** 语法,但因为了不与 Java 8 新添的 `forEach()` 产生混淆,因此我称之为 **for-in** 循环。 (Python 已有类似的先例,如:**for x in sequence**)。**注意**:你可能会在其他地方看到不同叫法。

Expand Down
Empty file modified docs/book/11-Inner-Classes.md
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion docs/book/18-Strings.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ String x = Immutable.upcase(s);


<!-- Overloading + vs. StringBuilder -->
## `+` 的重载与 `StringBuilder`
## + 的重载与 StringBuilder
`String` 对象是不可变的,你可以给一个 `String` 对象添加任意多的别名。因为 `String` 是只读的,所以指向它的任何引用都不可能修改它的值,因此,也就不会影响到其他引用。

不可变性会带来一定的效率问题。为 `String` 对象重载的 `+` 操作符就是一个例子。重载的意思是,一个操作符在用于特定的类时,被赋予了特殊的意义(用于 `String` 的 `+` 与 `+=` 是 Java 中仅有的两个重载过的操作符,Java 不允许程序员重载任何其他的操作符 [^1])。
Expand Down
2 changes: 1 addition & 1 deletion docs/book/19-Type-Information.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Triangle.draw()
但是,有时你会碰到一些编程问题,在这些问题中如果你能知道某个泛化引用的具体类型,就可以把问题轻松解决。例如,假设我们允许用户将某些几何形状高亮显示,现在希望找到屏幕上所有高亮显示的三角形;或者,我们现在需要旋转所有图形,但是想跳过圆形(因为圆形旋转没有意义)。这时我们就希望知道 `Stream<Shape>` 里边的形状具体是什么类型,而 Java 实际上也满足了我们的这种需求。使用 RTTI,我们可以查询某个 `Shape` 引用所指向对象的确切类型,然后选择或者剔除特例。

<!-- The Class Object -->
## `Class` 对象
## Class 对象

要理解 RTTI 在 Java 中的工作原理,首先必须知道类型信息在运行时是如何表示的。这项工作是由称为 **`Class`对象** 的特殊对象完成的,它包含了与类有关的信息。实际上,`Class` 对象就是用来创建该类所有"常规"对象的。Java 使用 `Class` 对象来实现 RTTI,即便是类型转换这样的操作都是用 `Class` 对象实现的。不仅如此,`Class` 类还提供了很多使用 RTTI 的其它方式。

Expand Down
2 changes: 1 addition & 1 deletion docs/book/21-Arrays.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ After sorting: [[i = 21, j = 6], [i = 70, j = 7], [i = 41, j = 20] ,
```

<!-- Using Arrays.sort() -->
## Arrays.sort()的使用
## Arrays.sort 的使用

使用内置的排序方法,您可以对实现了 **Comparable** 接口或具有 **Comparator** 的任何对象数组 或 任何原生数组进行排序。这里我们生成一个随机字符串对象数组并对其排序:

Expand Down
2 changes: 1 addition & 1 deletion docs/book/24-Concurrent-Programming.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Java采用了更传统的方法[^2],即在顺序语言之上添加对线程的
Java是一种多线程语言,不管你有没有意识到并发问题,它就在那里。因此,有许多Java程序正在使用中,或者只是偶然工作,或者大部分时间工作并且不时地发生问题,因为。有时这种问题是相对良性的,但有时它意味着丢失有价值的数据,如果你没有意识到并发问题,你最终可能会把问题放在其他地方而不是你的代码中。如果将程序移动到多处理器系统,则可以暴露或放大这些类型的问题。基本上,了解并发性使你意识到正确的程序可能会表现出错误的行为。

<!-- The Brutal Truth -->
## <span id = "The-Brutal-Truth">残酷的真相</span>
## 残酷的真相

当人类开始烹饪他们的食物时,他们大大减少了他们的身体分解和消化食物所需的能量。烹饪创造了一个“外化的胃”,从而释放出能量去发展其他的能力。火的使用促成了文明。

Expand Down
2 changes: 1 addition & 1 deletion docs/book/Appendix-Standard-IO.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Echo {

`BufferedReader` 提供了 `lines()` 方法,返回类型是 `Stream<String>` 。这显示出流模型的的灵活性:仅使用标准输入就能很好地工作。 `peek()` 方法重启 `TimeAbort`,只要保证至少每隔两秒有输入就能够使程序保持开启状态。

## 将`System.out` 转换成 `PrintWriter`
## 将 System.out 转换成 PrintWriter

`System.out` 是一个 `PrintStream`,而 `PrintStream` 是一个`OutputStream`。 `PrintWriter` 有一个把 `OutputStream` 作为参数的构造器。因此,如果你需要的话,可以使用这个构造器把 `System.out` 转换成 `PrintWriter` 。

Expand Down
32 changes: 16 additions & 16 deletions docs/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -352,22 +352,22 @@
repo: 'https://github.com/LingCoder/OnJava8',
loadSidebar: 'sidebar.md',
// subMaxLevel: 3,
search: {
paths: 'auto',
placeholder: '🔍 点击搜索 ',
noData: '😞 没有结果! ',
// Headline depth, 1 - 6
depth: 6
},
copyCode: {
buttonText : '复制',
errorText : 'Error',
successText: 'OK!'
},
pagination: {
previousText: '上一章节',
nextText: '下一章节',
},
search: {
paths: 'auto',
placeholder: '🔍 点击搜索 ',
noData: '😞 没有结果! ',
// Headline depth, 1 - 6
depth: 6
},
copyCode: {
buttonText : '复制',
errorText : 'Error',
successText: 'OK!'
},
pagination: {
previousText: '上一章节',
nextText: '下一章节',
},
coverpage: true,
}
</script>
Expand Down
Loading