close
The Wayback Machine - https://web.archive.org/web/20210118155920/https://github.com/LingCoder/OnJava8/pull/572
Skip to content
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

第九章多态 #572

Open
wants to merge 5 commits into
base: master
from
Open

第九章多态 #572

wants to merge 5 commits into from

Conversation

@chong-xiaowu
Copy link
Contributor

@chong-xiaowu chong-xiaowu commented Sep 11, 2020

87行的“因此”改为“因为”感觉更符合语义

lyc and others added 3 commits Sep 2, 2020
更新
@@ -85,7 +85,7 @@ public class Music {
Wind.play() MIDDLE_C
```

`main()` 中你看到了 `tune()` 方法传入了一个 **Wind** 引用,而没有做类型转换。这样做是允许的—— **Instrument** 的接口一定存在于 **Wind** 中,因此 **Wind** 继承了 **Instrument**。从 **Wind** 向上转型为 **Instrument** 可能“缩小”接口,但不会比 **Instrument** 的全部接口更少。
`main()` 中你看到了 `tune()` 方法传入了一个 **Wind** 引用,而没有做类型转换。这样做是允许的—— **Instrument** 的接口一定存在于 **Wind** 中,因为 **Wind** 继承了 **Instrument**。从 **Wind** 向上转型为 **Instrument** 可能“缩小”接口,但不会比 **Instrument** 的全部接口更少。

This comment has been minimized.

@sjsdfg

sjsdfg Sep 11, 2020
Collaborator

这句话整个语序都有问题吧,找原文上来一起改进下

This comment has been minimized.

@chong-xiaowu

chong-xiaowu Sep 14, 2020
Author Contributor

没找到原文资源,qq群通过下,我看一下原文,申请qq:1126802952

chong-xiaowu and others added 2 commits Sep 14, 2020
更新
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.